The main programming language that we will be using in Term 2.
What is Java?
This Java statement prints Hello, World! and then moves to a new line.
What is System.out.println("Hello, World!");?
This keyword is used to declare a method that does not return a value.
What is void?
The index of the first element in a Java array?
What is 0?
This Java keyword allows you to use a class from another package by its simple name.
What is import?
Unlike C++, Java source code is typically organized around this programming structure.
What are classes?
If System.out.println(); moves to a new line, then System.out.print();...
What is prints without moving to a new line?
In the declaration public static void main(String[] args), this word is the method's name.
What is main?
To access the second element of an array named scores, you use...
What is scores[1]?
This keyword declares a class in Java.
What is class?
This punctuation ends an ordinary Java statement.
What is a semicolon?
This symbol is commonly used to call a method on an object, as in scanner.nextLine()?
What is the dot operator (.).?
Complete the statement to create an integer array with five elements: int[] numbers = ____;
What is new int[5]?
This package contains the Scanner class.
What is java.util?
This is the conventional name of the method where a standard Java application begins execution.
What is main?
What does System.out.println("5" + 3); display?
What is 53?
In public static int add(int a, int b), the first int represents...
What is the method's return type?
An array named grades contains 8 elements. This expression gives its length.
What is grades.length (without parentheses)?
Complete the import statement:
import java.util.____;
What is Scanner?
public class Main { ... }. If Main is declared public, this should be the source file name.
What is Main.java?
What does this code print?
System.out.print("Java");
System.out.println("Rocks");
What is JavaRocks, followed by a newline?
The difference between defining a method and calling a method.
What is defining a method declares its behavior; calling it executes that method?
This code prints...
int[] nums = {10, 20, 30};
System.out.println(nums[2]);
What does scanner.nextLine() do when scanner is a Scanner reading keyboard input?
What is reads the next line of text entered by the user?