keywords
truth tables
algorithms
runtime vs compiletime (double points if specific error is given)
miscellaneous (not compsci related)
100

keyword that creates a new instance of an object 

new

100

MUST BE ABLE TO EXPLAIN WHY:

A=true B=true C = false

boolean D = (A||B && C )

System.out.println(D)

false

100

int x = 0

while (x<10){
x++;
}

how many times will the while run(condition evaluated to "true")?

10

100

int x = (double) 5;

compile incompatible types

100

whats my fav color

blue

200

can be accessed by other classes

public

200

A=true B=false


boolean c = !(A||B)

System.out.println(c);


true

200

for(int x = 5; x>0; x++){

    System.out.println(x);

}

infinite loop!!!

200

System.out.println(4/0);

String c;

System.out.println(c)

compile time

nullpointerexception - c is not initialized

200

Which city do my parents live in

Johannesburg

300

we check to see if something is true name all 4 keywords that do this (loops too)

for , while , if , else if

300

boolean c = (3.0 >= 4.0) || !(true || false)

false

300
int a = (int) 5.5 + 4;

int b = 18 - (8.5*2);

b = a + b?

10

300

System.out.println(4/0);


runtime error due to division by 0 = NaN

arithmeticexception

300

What sports do I coach at CDS since august till now

Volleyball , Swimming

400

no return value

void

400

boolean c = !(4=>5)

true, new cond is (4<5) by using demorgans law

400

double a = (int) 5.5 + 4;

int b = 18 - (8.5*2);

b = a + b?

error double cannot go into int

400

String awesomeSauce = "samsung";

int q = awesomeSauce.indexOf("i");

System.out.println(awesomeSauce.substring(q,q+1);

runtime - indexoutofbounds

indexof will return -1 there is no i

400

What was my first car?

Blue VW Beetle

500

static

does not need an instance of a class to be called and can be modified by all methods of the class with effects that last

500

x=0

a=2


boolean c = (x!=0) &&((3.0*4 == 7*x)&&(4.0*2!=16/2 && 4/2=a*(int) Math.random())

false 

500

String str = "racecar";

for(int i = str.length()-1; i > -1; i--){

System.out.print(str.substring(i,i+1);


}

racecar

500

public int mystery(){

int x = 100;

if (x>10){

x++;

mystery(x)

}

return 1
}

runtime error due to infinite recursion

stackoverflowerror

500

How many siblings do I have?

one younger but big brother