Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

OOP - MCQ QUIZ

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

Which OOP principle helps achieve modularity and reduces code duplication through hierarchical class structures?

a)

Encapsulation

b)

Polymorphism

c)

Inheritance

d)

Abstraction

2.

Which type of binding enables runtime polymorphism in Java?

a)

Static binding

b)

Early binding

c)

Dynamic binding

d)

Hybrid binding

3.

When a child class provides a specific implementation for a method already defined in the parent class, it is known as

a)

Method overloading

b)

Method overriding

c)

Encapsulation

d)

Constructor chaining

4.

Which keyword is used to explicitly invoke a superclass constructor?

a)

this

b)

super

c)

parent

d)

extends

5.

Which of the following is NOT allowed in method overriding?

a)

Increasing method visibility

b)

Decreasing method visibility

c)

Using the same return type

d)

Using same parameter list

6.

Interfaces in Java can be used to implement

a)

Single inheritance

b)

Multiple inheritance

c)

Only static methods

d)

Only abstract classes

7.

A class can implement multiple interfaces because

a)

It allows mixing abstract and concrete methods

b)

It supports design flexibility

c)

Interfaces contain only method signatures

d)

All the above

8.

Which of the following cannot be declared inside an interface?

a)

default methods

b)

static methods

c)

private methods

d)

constructors

9.

Abstract classes differ from interfaces because abstract classes

a)

cannot have constructors

b)

can have both abstract and concrete methods

c)

must contain only abstract methods

d)

can be instantiated

10.

The final keyword in Java prevents

a)

variable reassignment

b)

method overriding

c)

class inheritance

d)

all of the above

11.

Autoboxing in Java automatically converts

a)

wrapper to primitive

b)

primitive to wrapper

c)

String to integer

d)

object to String

12.

Unboxing happens during

a)

method overloading

b)

array access

c)

wrapper to primitive conversion

d)

compilation

13.

Which exception type must be handled using try-catch or throws keyword?

a)

Runtime exception

b)

Unchecked exception

c)

Checked exception

d)

Error

14.

What happens if a checked exception is not handled?

a)

Program runs normally

b)

Compile-time error

c)

JVM handles it automatically

d)

It becomes an unchecked exception

15.

Which block executes even if an exception occurs or does not occur?

a)

try

b)

catch

c)

finally

d)

throw

16.

Which keyword is used to manually throw an exception?

a)

throws

b)

throw

c)

final

d)

return

17.

The throws keyword is used

a)

inside a catch block

b)

in method signature

c)

to catch exceptions

d)

to raise errors

18.

Which of the following cannot be caught using try-catch?

a)

IOException

b)

ArithmeticException

c)

NullPointerException

d)

OutOfMemoryError

19.

The main purpose of multithreading is to

a)

speed up execution by parallelism

b)

reduce memory usage

c)

simplify code

d)

reduce exceptions

20.

Calling run() directly on a Thread object results in

a)

new thread creation

b)

normal method execution

c)

compile-time error

d)

thread blocked

21.

Which thread state indicates the thread is ready but waiting for CPU allocation?

a)

New

b)

Runnable

c)

Waiting

d)

Terminated

22.

Calling wait() on an object causes the thread to enter

a)

Dead state

b)

Waiting state

c)

Timed waiting state

d)

Runnable state

23.

sleep() method puts the thread into

a)

waiting state

b)

runnable state

c)

timed waiting state

d)

blocked state

24.

Synchronization ensures

a)

faster execution

b)

consistent shared resource access

c)

prevention of memory leaks

d)

more threads

25.

Race conditions occur when

a)

multiple threads access shared resources simultaneously

b)

only one thread accesses shared resource

c)

threads run sequentially

d)

thread is blocked

26.

synchronized keyword can be applied to

a)

methods

b)

code blocks

c)

static methods

d)

all of the above

27.

Which thread creation method promotes loose coupling?

a)

Extending Thread class

b)

Implementing Runnable interface

c)

Both provide coupling

d)

None

28.

In multithreading, the term “dead” or “terminated” means

a)

thread is blocked

b)

thread completed execution

c)

thread is waiting

d)

thread is ready

29.

Using synchronized excessively may lead to

a)

faster execution

b)

improved CPU utilization

c)

performance bottlenecks

d)

better abstraction

30.

Which exception is thrown when array index goes out of range?

a)

ArrayIndexOutOfBoundsException

b)

IOException

c)

IllegalStateException

d)

ClassCastException