SCJP Cheat Sheet 2026

The 30 highest-yield SCJP facts, distilled from real exam questions. Print it, save it as a PDF, or study it here — free, no sign-up.

72 questions
210 min time limit
65.00% to pass
  1. Which Java feature allows a class to inherit behavior from multiple sources without multiple inheritance of classes? Interfaces with default methods
  2. Which of the following is true about abstract classes in Java? They can contain both abstract and concrete methods
  3. Which Java I/O class should be used to write primitive data types (int, double, boolean) to a stream? DataOutputStream
  4. Which of the following methods can modify a String object, s? none of the above will change s
  5. In Java, can a single `catch` block catch multiple exception types? Yes, using a pipe (|) separator since Java 7 (multi-catch)
  6. The following class(es)' methods can be used to create directories: File
  7. Which interface should be implemented to allow objects to be sorted using `Arrays.sort()` without a Comparator? Comparable
  8. Which of the following is NOT part of the Java Collections Framework hierarchy? Array
  9. Which of the following is a correct way to create a new thread in Java? Extend Thread class or implement Runnable interface
  10. Which of the following correctly describes method overloading in Java? Same method name, different parameter list in the same class
  11. What does the String method replace(char oldChar, char newChar) return? A new String with all occurrences of oldChar replaced by newChar
  12. What is an enum in Java? A special class that represents a group of named constants
  13. In Java, which method pair is used for inter-thread communication? notify() and wait()
  14. Which of the following initialization strategies for the array "dayhigh" with seven values is correct? int dayhigh[] = { 24, 23, 24, 25, 25, 23, 21 };
  15. Which of the following statements about a two-dimensional array of numbers is legal? int[]a[] = new int[5][5];
  16. What does the `PriorityQueue` class use to determine the order of elements? Natural ordering or a Comparator
  17. What does the `Collections.sort()` method require from the objects it sorts? Objects must implement Comparable
  18. Which concurrent collection class is designed for high-concurrency scenarios and partitions its data to reduce lock contention? ConcurrentHashMap
  19. What is encapsulation in Java? Hiding implementation by restricting direct access to fields and exposing via methods
  20. What is the effect of marking a class member as `private`? Accessible only within the declaring class
  21. What happens when a subclass constructor does not explicitly call a superclass constructor? The default no-arg superclass constructor is called implicitly
  22. Which method of the Pattern class is used to compile a regular expression? Pattern.compile()
  23. In Java, which method retrieves an enum constant by its name string? EnumType.valueOf(name)
  24. Which of the following best describes the order in which a component is redrawn as a result of method calls? invoke repaint() which invokes update(), which in turn invokes paint()
  25. Which of the following correctly declares a generic method in Java? public T swap(T a, T b)
  26. What does the regex quantifier {2,5} mean? Between 2 and 5 occurrences (inclusive)
  27. In Java, what is the default behavior when a thread encounters an uncaught exception? The thread terminates and the JVM continues
  28. Only one of the five Component methods listed below is also a method of the class MenuItem. Which one? setEnabled( boolean b )
  29. Which method must be overridden in a class for its objects to work correctly as HashMap keys? equals() and hashCode()
  30. Which method is used to start a thread's execution in Java? start()
Turn these facts into recall: