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 static initializer blocks? → They run once when the class is first loaded
- Which of the following correctly describes the behavior of the finally block? → It always executes unless System.exit() is called
- 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)
- Which interface must be implemented by a class to allow its objects to be sorted using Collections.sort()? → Comparable
- 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 true about Java's 'break' statement in a switch block? → It prevents fall-through to the next case
- What will be the result of 7 % 3 in Java? → 1
- Which of the following is a correct way to create a new thread in Java? → Extend Thread class or implement Runnable interface
- In Java generics, what does the wildcard '? extends T' indicate? → Any type that is a subtype of T or T itself
- Which of the following correctly describes method overloading in Java? → Same method name, different parameter list in the same class
- What is the effect of calling `System.gc()`? → It is a request to the JVM to run garbage collection; the JVM may ignore it
- What does the String method replace(char oldChar, char newChar) return? → A new String with all occurrences of oldChar replaced by newChar
- Which collection class is best suited for implementing a LIFO (Last-In-First-Out) stack in modern Java? → java.util.ArrayDeque
- Which loop is guaranteed to execute its body at least once? → do-while
- What is the result of: `Integer x = 200; Integer y = 200; System.out.println(x == y);`? → false
- What is an enum in Java? → A special class that represents a group of named constants
- Which collection class allows null keys and null values? → HashMap
- What is the default value of an instance variable of type boolean in Java? → false
- 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 is the output of the following code? String s1 = "Java"; String s2 = "Java"; System.out.println(s1 == s2); → true
- Which of the following interface features was introduced in Java 8 that affects how classes implement interfaces? → Interfaces can have default methods with concrete implementations
- What does the `PriorityQueue` class use to determine the order of elements? → Natural ordering or a Comparator
Turn these facts into recall:
Was this helpful?