Home > Java Programming > Quizzes > Java Fundamentals Test
Java Fundamentals Test
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 22% Most missed: “The keyword 'volatile' on a field is used in Java to:”
Java Fundamentals Test
Time left 00:00
25 Questions

1. When using swing - which of the following is NOT a method on a JCheckBox object?
2. Are static fields of a class included in serialization?
3. The @Override annotation
4. Which of the following is correct for the 'main' method of a class?
5. Given the code: Integer i= new Integer('1'); if (i.toString() == i.toString()) System.out.println('Equal'); else System.out.println('Not Equal');
6. What is displayed when the following code is compiled and executed? String s1 = new String('Test'); String s2 = new String('Test'); if (s1==s2) System.out.println('Same'); if (s1.equals(s2)) System.out.println('Equals');
7. Will a program run if the main() is not static?
8. Consider the following code snippet String river = new String(???Columbia???); System.out.println(river.length()); What is printed?
9. Which of the following can be abstract?
10. What is the keyword to forbid the serialization of an instance field?
11. How do you prevent a class from being extended by a subclass?
12. A function that defines the steps necessary to instantiate one object of that class is called:
13. The Java Virtual Machine manages its own:
14. Which of the following is *not* a method in java.lang.String?
15. How do we compare enum types in java
16. Does Java provide any construct to find out the size of an object?
17. You read the following statement in a valid Java program: submarine.dive(depth); What must be true?
18. What is the proper syntax for a Java class's main method?
19. TreeMap class is used to implement which collection interface?
20. What does a synchronized method use as a mutex in Java?
21. ________ is when a subclass implements a method that is already provided by a superclass.
22. Which of the following statements is true?
23. Is it possible to create zero length arrays?
24. Which of the following APIs is used to create secure socket connections and manage digital certificates?
25. What effect does declaring a method as final have?