Math
Java Basics
Flow of Control
Arrays
Strings
100

10/4

What is 2 ?

100

What primitive type is used for decimal values?

What is double?

100

What is the output?

int x = 789;
if(x>700)
 out.println("big");
else
 out.println("little");

What is big ?

100

This is returned from arr[3] if arr={6, 3, 1, 2} 

What is 2?

100

System.out.print("catastrophe".substring(4));

What is "strophe" ?

200

10/4.0

What is 2.5 ?

200

What is the value of x after the following sequence of statements?

int x = 10;

x--;
x++;

What is x?

200

What is the returned by the call  go(-6) ?

public static int go(int x)
{
 if( x > 0 )
   return 1;
 return 2;

What is 2 ?

200

What is output by the code below?

int[] array = {33,14,37,11,27};
out.println(array[array.length-1]);

What is 27 ?

200

System.out.print("catastrophe".substring(4,5));

What is "s" ?

300

11 / 2 * 3

What is 15 ?

300

What primitive type can only hold two values?

What is boolean?

300

What is output by the code below?

int w=100, x=88;
if(w>90)
 if(x>80)
 out.print("def");
 else
 out.print("xyz");
else
 out.print("ghi");
out.print("fun");

What is deffun ?

300

What is output by the code below?

String[] ray = {"abc","ade","123","234","678"};
out.println(ray[5/2]);

What is 123 ?

300

System.out.print("catastrophe".indexOf("a"));

What is 1 ?

400

(int) (10.01 / 4.99)

What is 2 ?

400

What is the output by the code below?
int x = 9;
double y = x;
System.out.println(y);








What does the following evaluate to?

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

What is 9.0?

400

int x = 1;

while (x != 100) {

x*=2;

}

System.out.println(x);

This is the the result of the executing the code above.

What is no output (infinite loop)?

400

int[] array = {5,10,3,6,9,15};
for(int i=0; i<array.length/2; i=i+2)
{  
   array[i]=array[array.length-i-1];
}
out.println(array[0]);

What is 15 ?

400

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











"catastrophe".substring(0);

What is 1353?

500

(double) (10/4)

What is 2.0 ?

500

converting from one data type to another

What is casting?

500

int x=1;
while(x<5) {
System.out.print(x);
x++; }

What is 1234 ?

500

What is the output?

int[] nums = {5,8,9,6,3,0};

Arrays.sort(nums);

int loc = Arrays.binarySearch(nums,7);

What is -5 ?

500

System.out.print("catastrophe".length());

What is 11?

M
e
n
u