Variables
Conditional Statements
Scanner
Loops
Miscellaneous
100

Name the 8 primitive data types

byte, short, int, long, double, float, boolean, String

100

Name two types of conditional statements

if-else if-else and switch

100

What is the scanner class used for?

Reading information from the user

100

Name two types of loops

While loop, for loop

100

Definition of platform independence

Works on all platforms

200

What is a variable?

Used to store values in Java

200

What are the conditional operators?

==, >=, <=, <, >, ==, !=, ||, &&, !

200

What is an import

used to import code that others have written, reuse code

200

Is for loop a definite loop?

yes

200

full form of JVM, JDK

Java Virtual Machine, Java Development Kit

300

Name two rules for naming variables in Java

Case sensitive, camel case, can only start with $, _, 

300

What is the symbol for not equal to

!=

300

What is the import statement for Scanner

import java.util.Scanner;

300

Is while loop a definite loop?

No
300

What does Java have that is unique in turning source code to machine language

JVM to compile byte code

400

Write a code fragment to assign a value of 4 to an integer named hello.

int hello = 4;

400

Write a code fragment checking if a variable a is greater than 2, if it is print true, if not print false.

if(a>2){

System.out.println("true");

}

else{

System.out.println("false");

}

400

Initialize a Scanner called inp;

Scanner inp = new Scanner(System.in);
400

Write a for loop looping through 1 through 10 and printing it

for( int i = 1; i<11; i++){

System.out.println(i);

}

400

What edition is Java on?

8

500

Is String a primitive type?

NOOO

500

What does the following code fragment output?

int x = 1;

if(x<3){

return true;}

else if(x<2){

return false;}

else{

return true;}


true

500

Read in an integer from the user

int a = inp.nextInt();

500
Write an infinite loop with a while loop

int i = 1;

while(i==1){

}

500

Who invented Java

James Gosling