Q1
Which option correctly describes the relationship among JDK, JRE, and JVM?
Q2
Java source code is compiled into:
Q3
Java is not considered a purely object-oriented language mainly because:
Q4
Which of the following is the wrapper class for `int`?
Q5
Java argument passing is:
Q6
Objects created using `new` are generally stored in:
Q7
What is the primary role of a classloader in Java?
Q8
Why is the `main` method declared as `static` in Java?
Q9
Which option correctly matches the term with its purpose?
Q10
Autoboxing means:
Q11
Which statement about Java `String` is correct?
Q12
What is true for two identical string literals in Java?
Q13
For strings in Java, `equals()` checks:
Q14
Which class should generally be preferred for repeated string modification in a single-threaded context?
Q15
Which statement about `StringBuffer` is correct?
Q16
What does `intern()` return for a string?
Q17
Why is `String` often a good key in `HashMap`?
Q18
For repeated concatenation inside a loop, which choice is usually best?
Q19
Why might `char[]` be preferred over `String` for passwords?
Q20
What is the result of `new String("java") == "java"`?
Q21
A checked exception in Java is one that:
Q22
Which of the following is an unchecked exception?
Q23
Which statement correctly compares `throw` and `throws`?
Q24
Which block usually runs whether or not an exception occurs?
Q25
Try-with-resources works best with objects that implement:
Q26
A custom checked exception is usually created by extending:
Q27
Which catch order is valid?
Q28
If both `try` and `finally` contain `return` statements, which one wins?
Q29
Which statement about `Error` in Java is correct?
Q30
Which statement about multi-catch in Java is correct?
Q31
Which statement about `Map` is correct?
Q32
Which collection type preserves insertion order and allows duplicates?
Q33
Which collection type is mainly used when duplicate elements should be avoided?
Q34
Which statement about `ArrayList` is most accurate?
Q35
Compared to `ArrayList`, `LinkedList` is usually better when:
Q36
Which statement about `HashMap` is correct?
Q37
How does `Hashtable` differ from `HashMap`?
Q38
Which set implementation keeps elements in sorted order?
Q39
Which interface allows bidirectional traversal of list elements?
Q40
A fail-fast iterator usually reacts to structural modification by throwing:
Q41
What is the main benefit of Java generics?
Q42
Using a raw type such as `List` instead of `List<String>` mainly causes:
Q43
Type erasure in Java means:
Q44
Which wildcard is usually preferred when a structure mainly produces values of type `T`?
Q45
Which wildcard is usually preferred when a structure mainly consumes values of type `T`?
Q46
What is the main purpose of an enum in Java?
Q47
A lambda expression in Java is mainly used with:
Q48
A functional interface must contain:
Q49
What is the main advantage of the Stream API?
Q50
Why is `Optional` useful in Java APIs?
Q51
What is the difference between calling `start()` and calling `run()` on a thread object?
Q52
Which statement about `wait()` is correct?
Q53
Which statement about `sleep()` is correct?
Q54
The `synchronized` keyword mainly provides:
Q55
What is the main purpose of `volatile` in Java?
Q56
Which statement about daemon threads is correct?
Q57
Why is implementing `Runnable` often preferred over extending `Thread`?
Q58
What happens if the same `Thread` object is started twice?
Q59
What is the main purpose of JIT compilation in Java?
Q60
A static synchronized method locks on: