1. Finally is used to....
2. The Thread.sleep() method:
3. Can an abstract class be a final class?
4. You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?
5. What is the output? int[] xxx = {10, 20}; List<String> list = new ArrayList<String>(10); list.add("01"); list.add("02"); System.out.println(xxx.length + ", " +list.size());
6. Immutable objects are always...
7. enum Example { ONE, TWO, THREE } Which statement is true?
8. After the following code fragment, what is the value in a? String s; int a; s = "Foolish boy."; a = s.indexOf("fool");
9. What is the direct parent of "Error" class?
10. What will be printed out if you attempt to compile and run the following code? int i=9; switch (i) { default: System.out.println("default "); case 0: System.out.println("zero "); break; case 1: System.out.println("one "); case 2: System.out.println("two "); }
11. class X implements Runnable { public static void main(String args[]) { /* Missing code? */ } public void run() {} } Which of the following line of code is suitable to start a thread ?
12. java.util.Collection is:
13. LinkedBlockingQueue is useful for...
14. @Inject annotation belongs to
15. HTML based Java Documentary help can be accessed using.. ?
16. What is @Override annotation used for?
17. which of the following is correct syntax of varargs
18. A RuntimeException is...
19. What is the difference between HashMap and HashTable?
Core Java MCQs | Topic-wise