Math
Java Basics
Flow of Control
Arrays
Strings
100

10/4

What is 2 ?

100

The decimal equivalent of 110100 binary is ____.

What is 52?

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?

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 is the ASCII value of b?

What is 98?

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

What does the following code fragment write to the monitor?

int height = 13; if ( height <= 12 )  System.out.print("Low bridge: "); System.out.println("proceed with caution.");

What is proceed with caution ?

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

What is the output by the code below?

String s = "abcdef";
System.out.println( s );

What is abcdef ?

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?