Unit-1
Unit-2
Unit-3
Unit-4
Unit-5
100

Which of the following best defines the principles of Object-oriented language?

A) Emphasizes code reusability and modularity

100

Which keyword is used to refer to the current instance of a class in Java?

 this

100

Which keyword is used to handle exceptions in Java?

catch

100

When creating multiple threads in Java, what determines the order of execution?

The scheduling algorithm of the operating system

100

Which of the following is NOT a method provided by the List interface in Java?

sort()

200

What is the purpose of Java Virtual Machine (JVM)?

B) To execute Java bytecode

200

What is the keyword used in Java to derive a class from another class?

extends

200

What is a user-defined exception in Java?

 An exception defined by the user to handle specific errors.

200

What is the purpose of the wait(), notify(), and notifyAll() methods in Java synchronization?

To coordinate the activity of threads accessing shared resources

200

In terms of efficiency, which data structure is most suitable for implementing a queue in Java?

LinkedList

300

What is the correct order of precedence for the following operators: *, /, +, - ?  

A) , /, +, -

300

When a subclass provides a specific implementation of a method that is already defined in its superclass, it is called:

Overriding

300

In Java, which class is used to handle exceptions that are not caught by the program?

Throwable

300

Which of the following is NOT a technique for thread synchronization in Java?

 Using thread.join() method

300

What is the purpose of the static methods provided by the Collections class in Java?

To provide utility methods for working with collections

400

Which keyword is used to declare a method in Java?

D) public

400

Which keyword in Java is used to declare a method without providing an implementation?

abstract

400

What method is used in Java to concatenate two strings?

concat()

400

When is thread synchronization necessary in Java?

When multiple threads are accessing shared resources concurrently

400

Which of the following represents a collection that orders its elements based on their natural ordering or using a Comparator?

PriorityQueue

500

What is the purpose of a constructor in Java?

To create new objects

500

What distinguishes an interface from an abstract class in Java?

Interfaces can have variables.

500

Which class in Java is used to represent and manipulate strings?

 String

500

Which method is used to start the execution of a thread in Java?

start()

500

Which of the following classes in Java represents a resizable array, similar to ArrayList but with synchronized methods?

Vector