Logo

Java Questions Set 51:

Quiz Mode

Which of the following is a reserved keyword in Java?

1
2
3
4

Solution:

Which access modifier is also known as Universal access modifier?

1
2
3
4

Solution:

How can we filter lines based on content? 

1
2
3
4

Solution:

 Which of these types of parameters is used for a generic class to return and accept any type of object?

1
2
3
4

Solution:

If you want to write multiple functions in a class with same name, then what Java feature will you use?

1
2
3
4

Solution:

Which of these methods of the MimeHeader class is used to return the string equivalent of the values stored in the MimeHeader?

1
2
3
4

Solution:

Which of these is a correct way to create a list that is upper bounded by the Number class?

1
2
3
4

Solution:

Which statement is true about Java?

1
2
3
4

Solution:

Statement 1- Maps is not part of Java’s collection framework 

Statement 2- Array is not part of Java’s collection framework 

Statement 3- Stack is not part of Java’s collection framework 

1
2
3
4

Solution:

Predict the output of the following Java code:

import java.util.*;

import java.util.concurrent.LinkedBlockingQueue;

public class Abekus {

public static void main(String[] args) throws IllegalStateException {

Queue<String> que = new LinkedBlockingQueue<String>(4);

que.add("p");

que.add("r");

que.add("c");

que.add("g");

System.out.println(que.element());

}

}

1
2
3
4

Solution: