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