Q1
What is the primary advantage of Java’s bytecode?
Q2
Which of the following is NOT a feature of Object-Oriented Programming
in Java?
Q3
What is the role of the Java Virtual Machine (JVM)?
Q4
Which access specifier provides the most restrictive access in Java?
Q5
What happens when an object is no longer referenced in Java?
Q6
Which keyword is used to prevent method overriding in Java?
Q7
What is the purpose of the this keyword in Java?
Q8
In Java, method overloading is an example of:
Q9
Which statement about static methods is TRUE?
Q10
What is the difference between mutable and immutable strings in Java?
Q11
Which class in Java represents an immutable string?
Q12
What is the purpose of command line arguments in Java?
Q13
Which class is used for reading keyboard input with better performance?
Q14
What is the correct order of constructor calling in multilevel inheritance?
Q15
The super keyword is used to:
Q16
What is dynamic method dispatch in Java?
Q17
Which statement about abstract classes is TRUE?
Q18
What is the main difference between an interface and an abstract class?
Q19
In Java, all interface methods are implicitly:
Q20
What is the purpose of creating packages in Java?
Q21
Which keyword is used to import all classes from a package?
Q22
What is an exception in Java?
Q23
Which block is always executed in exception handling,
regardless of whether an exception occurs?
Q24
What is the difference between throw and throws?
Q25
Which exception type must be explicitly handled or declared?
Q26
How do you create a user-defined exception class?
Q27
What is multithreading in Java?
Q28
Which method starts a thread’s execution?
Q29
What are the two ways to create a thread in Java?
Q30
What is the main thread in Java?
Q31
Which method is used to set thread priority?
Q32
What is thread synchronization?
Q33
Which keyword is used to synchronize a method or block?
Q34
What is a deadlock in multithreading?
Q35
Which method is used to suspend a thread temporarily?
Q36
What is the purpose of the finalize() method?
Q37
In Java, parameters are passed to methods by:
Q38
What is a nested class?
Q39
Which of the following about inner classes is TRUE?
Q40
What is encapsulation in Java?
Q41
Which principle allows a subclass object to be treated
as a superclass object?
Q42
What is the purpose of garbage collection in Java?
Q43
Which of these is a valid thread state in Java?
Q44
What happens when a method in a subclass has the same signature
as in the super class?
Q45
Which exception is thrown when dividing by zero in integer arithmetic?
Q46
What is the Scanner class used for?
Q47
Which access level allows access within the same package and subclasses?
Q48
What is abstraction in OOP?
Q49
Which class should be used for mutable string operations with thread safety?
Q50
What is the default priority of the main thread?