What will print?
Data types
Object Oriented
libraries, operators, and main
Where's the error?
100

System.out.println("Hello World");

Hello World

100

This type can include words or sentences

String

100

How do I create a class called Car?

class Car 

or

class Car{

//code

}

100

What library should I import if I want to generate a random number?

The random library

or java.util.Random

100

Fix this line of code so it prints Hello World

System.out.println(Hello World);

System.out.println("Hello World")

200

System.out.println("5" + "5");

55

200

What can x be equal to?

boolean x;

true or false

200

The method that allows a class to create an instance of itself is called what?

The constructor

200

What is 11%22 equal to?

11

200

which line of code causes an error?

int [] x = new int [5];

x[5] = 1;

x[4] = 2;

x[3] = 3;

 

x[5] = 1;

300

float x = 20;

System.out.println(x);

20.0

300

Fill in the blank:

___ x = 'c';

char

300

I have an object called duck and I want to call an instance method called fly with it. How do I do this?

duck.fly();

300

What must x be to make z true

boolean x = ___

boolean y = true

boolean z = (x || y) && (!x && y)

false

300

What's wrong with this code?

int i = 5;

for(int i = 5; i>=0; i--)

     System.out.println(i)

System.out.println(i), missing ;

400

int [] array = {1, 2, 4};

for(int i = 0; i < array.length; i++)

     for(int j: array)

          System.out.println(j);

1

2

4

1

2

4

1

2

4

400

If this prints 1, what type is y?

int x = 3

___ y = x / 2;

System.out.println(y);

int

400

The class Character takes one integer as the health parameter. How do I create an instance of Character called steve with 100 health?

Character steve = new Character(100);
400

Which library can we use to create a User Interface (draw pictures)

the processing library

or

processing.core.PApplet

400

What is missing?

switch(choice) {

case1: System.out.println("You picked Warrior!");

case2:System.out.println("You picked Rogue!");

default:System.out.println("That wasn't an option.");

break; in all cases

500

String name = "Jeff";

String height = "56";

System.out.print("Hello my name is " + name);

System.out.print(" and I am \n" + "inches tall");

Hello my name is Jeff and I am 

inches tall

500

What is the difference between a float and a double?

They are different sizes

500

How do I create a public subclass of Car called Truck?

public class Truck extends Car

500

How do you write the main method?

public static void main(String [] args)

500

I want to catch an input mismatch exception, fill in the blanks:

___ {

System.out.println("Enter the amount:");

userMoney = input.nextFloat();}

____(InputMismatchException e){ 

input.nextLine();

System.out.println("That's not a number. ");

userMoney = 0;} 

try

catch

M
e
n
u