WorksheetsOOP - MCQ QUIZ
Total questions: 30
Worksheet time: 15mins
Which OOP principle helps achieve modularity and reduces code duplication through hierarchical class structures?
Encapsulation
Polymorphism
Inheritance
Abstraction
Which type of binding enables runtime polymorphism in Java?
Static binding
Early binding
Dynamic binding
Hybrid binding
When a child class provides a specific implementation for a method already defined in the parent class, it is known as
Method overloading
Method overriding
Encapsulation
Constructor chaining
Which keyword is used to explicitly invoke a superclass constructor?
this
super
parent
extends
Which of the following is NOT allowed in method overriding?
Increasing method visibility
Decreasing method visibility
Using the same return type
Using same parameter list
Interfaces in Java can be used to implement
Single inheritance
Multiple inheritance
Only static methods
Only abstract classes
A class can implement multiple interfaces because
It allows mixing abstract and concrete methods
It supports design flexibility
Interfaces contain only method signatures
All the above
Which of the following cannot be declared inside an interface?
default methods
static methods
private methods
constructors
Abstract classes differ from interfaces because abstract classes
cannot have constructors
can have both abstract and concrete methods
must contain only abstract methods
can be instantiated
The final keyword in Java prevents
variable reassignment
method overriding
class inheritance
all of the above
Autoboxing in Java automatically converts
wrapper to primitive
primitive to wrapper
String to integer
object to String
Unboxing happens during
method overloading
array access
wrapper to primitive conversion
compilation
Which exception type must be handled using try-catch or throws keyword?
Runtime exception
Unchecked exception
Checked exception
Error
What happens if a checked exception is not handled?
Program runs normally
Compile-time error
JVM handles it automatically
It becomes an unchecked exception
Which block executes even if an exception occurs or does not occur?
try
catch
finally
throw
Which keyword is used to manually throw an exception?
throws
throw
final
return
The throws keyword is used
inside a catch block
in method signature
to catch exceptions
to raise errors
Which of the following cannot be caught using try-catch?
IOException
ArithmeticException
NullPointerException
OutOfMemoryError
The main purpose of multithreading is to
speed up execution by parallelism
reduce memory usage
simplify code
reduce exceptions
Calling run() directly on a Thread object results in
new thread creation
normal method execution
compile-time error
thread blocked
Which thread state indicates the thread is ready but waiting for CPU allocation?
New
Runnable
Waiting
Terminated
Calling wait() on an object causes the thread to enter
Dead state
Waiting state
Timed waiting state
Runnable state
sleep() method puts the thread into
waiting state
runnable state
timed waiting state
blocked state
Synchronization ensures
faster execution
consistent shared resource access
prevention of memory leaks
more threads
Race conditions occur when
multiple threads access shared resources simultaneously
only one thread accesses shared resource
threads run sequentially
thread is blocked
synchronized keyword can be applied to
methods
code blocks
static methods
all of the above
Which thread creation method promotes loose coupling?
Extending Thread class
Implementing Runnable interface
Both provide coupling
None
In multithreading, the term “dead” or “terminated” means
thread is blocked
thread completed execution
thread is waiting
thread is ready
Using synchronized excessively may lead to
faster execution
improved CPU utilization
performance bottlenecks
better abstraction
Which exception is thrown when array index goes out of range?
ArrayIndexOutOfBoundsException
IOException
IllegalStateException
ClassCastException
