Methods
Variables
Notation
Loops
Classes/Program Design
100

Inside the parentheses of the method

Parameter

100

Used to store whole numbers

int variables

100

The correct way to write a print statement that jumps to the next line after execution

System.out.println();

100

The main purpose of loops (think one general word)

Repetition

100

Using the same constructor to make different objects

Overloading

200

How to call a method outside the class (class = ClassName & method = methodName)

ClassName.methodName(arguments);

200

A true/false statement

boolean variables

200

The correct way to declare/initialize an int variable "numStudents" with a value of 15

int numStudents = 15;

200

The loop used when we know the number of times we want the statement to be executed

For loop

200

True/False: It is efficient to create an object of a class and use it outside the class

True

300

Class method that returns the square root of an int

Math.sqrt();

300

Keyword for a variable that cannot be accessed outside the class

private

300

The correct way to create a new Scanner object "input"

Scanner input = new Scanner(System.in);

300

Keyword to escape an infinite loop

break

300

Hiding implementation details of data structures and exposing only essential operations

Abstraction

400

public class Main {
  static void myMethod() {
    System.out.println("Hello World!");
  }

  public static void main(String[] args) {
    myMethod();
  }

What is the output of the shown code?

Hello World!

400

The default value for this variable is 0

Byte

400

The general notation for creating a new object (class = ClassName & object = objectName)

ClassName objectName = new ClassName(arguments);

400

What does the following code print?

for (int i = 2; i < 9; i++) 

{   

     System.out.print(i + ", "); 

}

2, 3, 4, 5, 6, 7, 8

400

Keyword that describes an object of the class

static

500

class Calculator {
        public int add(int a, int b) {
            return a + b;
        }

        public double add(double a, double b) {
            return a + b;
        }
    }

What concept is being conveyed?

Polymorphism

500

Consider the following code segment:

int x = 2; int y = 7; 

double result = y / (double) x; System.out.println(result);

What will be printed when this code is run?

3.5

500

The correct notation of the signature for the main method

public static void main (String[] args)

500

Consider the following loop, where n is some positive integer.

for (int i = 0; i < n; i += 2) 

{

    /* perform some action */ 

}

In terms of n, which Java expression represents the maximum number of times that /* perform some action */ could be executed?

(n + 1) / 2;

500

public class Main {

   public ____ (){

      System.out.println("Constructor called");

   }

}

Complete the constructor (fill in the blank)

Main