Logo

Java Questions Set 105:

Quiz Mode

Predict the output of the following Java code.

1
2
3
4

Solution:

Which of the following has highest priority for memory allocation.

1
2
3
4

Solution:

Which of the following is a pure object-oriented programming language?

1
2
3
4

Solution:

try{

}

Catch{

}

The above snippet is an example of?

1
2
3
4

Solution:

Which Java package contains classes and interfaces used for input and output operations?

1
2
3
4

Solution:

Features of the Java Virtual Machine (JVM)

1
2
3
4

Solution:

What is the output of the following Java code?

class Abekus {

public static void main(String[] args)

{

int A[] = { 4, 6, 10, 3, 34, 48 };

System.out.print(A[-5]);

}

}

1
2
3
4

Solution:

Choose the snippet which gives you the current working directory in Java

1
2
3
4

Solution:

Predict the output of the following Java code:

class Abekus {

public static void main(String[] args) {

int a = 0;

int b = 0;

for (int i = 0; i < 8; i++) {

if ((++a > 2) || (++b > 2)) {

a++;

}

}

System.out.println(a + " " + b);

}

}

1
2
3
4

Solution:

Select the correct option for this code.

public class Abekus {

public static void main(String[] args)

{

int A = 2147483647; //line 1

int A1 = 2147483659; // line 2

System.out.println(A);

System.out.println(A1);

}

}

1
2
3
4

Solution: