Logo

Java Questions Set 62:

Quiz Mode

Predict the output of the following Java code.

1
2
3
4

Solution:

What is the Java 8 replacement for PermGen?

1
2
3
4

Solution:

What does HQL stand for?

1
2
3
4

Solution:

What is a Collection in Java?

1
2
3
4

Solution:

Which of the following interfaces is not implemented by java.lang.String class?

1
2
3
4

Solution:

Which of these methods of class String is used to check whether a given object starts with a particular string literal.

1
2
3
4

Solution:

Which Java class allows you to access and retrieve information about private and protected members of a class?

1
2
3
4

Solution:

What is the output of the following Java code that demonstrates bitwise operators?

class bitwise_operator

{

public static void main(String args[])

{

int a = 3;

int b = 6;

int c = a | b;

int d = a & b;

System.out.println(c + " " + d);

}

}

1
2
3
4

Solution:

What will be the output of the following JAVA program? 

class GFG { static int d=1; static void count(int n) { System.out.print(n+" "); System.out.print(d+" "); d++; if(n > 1) count(n-1); System.out.print(d+" "); } public static void main(String args[]) { count(3); } }

1
2
3
4

Solution: