Which of the following best defines the principles of Object-oriented language?
A) Emphasizes code reusability and modularity
Which keyword is used to refer to the current instance of a class in Java?
this
Which keyword is used to handle exceptions in Java?
catch
When creating multiple threads in Java, what determines the order of execution?
The scheduling algorithm of the operating system
Which of the following is NOT a method provided by the List interface in Java?
sort()
What is the purpose of Java Virtual Machine (JVM)?
B) To execute Java bytecode
What is the keyword used in Java to derive a class from another class?
extends
What is a user-defined exception in Java?
An exception defined by the user to handle specific errors.
What is the purpose of the wait(), notify(), and notifyAll() methods in Java synchronization?
To coordinate the activity of threads accessing shared resources
In terms of efficiency, which data structure is most suitable for implementing a queue in Java?
LinkedList
What is the correct order of precedence for the following operators: *, /, +, - ?
A) , /, +, -
When a subclass provides a specific implementation of a method that is already defined in its superclass, it is called:
Overriding
In Java, which class is used to handle exceptions that are not caught by the program?
Throwable
Which of the following is NOT a technique for thread synchronization in Java?
Using thread.join() method
What is the purpose of the static methods provided by the Collections class in Java?
To provide utility methods for working with collections
Which keyword is used to declare a method in Java?
D) public
Which keyword in Java is used to declare a method without providing an implementation?
abstract
What method is used in Java to concatenate two strings?
concat()
When is thread synchronization necessary in Java?
When multiple threads are accessing shared resources concurrently
Which of the following represents a collection that orders its elements based on their natural ordering or using a Comparator?
PriorityQueue
What is the purpose of a constructor in Java?
To create new objects
What distinguishes an interface from an abstract class in Java?
Interfaces can have variables.
Which class in Java is used to represent and manipulate strings?
String
Which method is used to start the execution of a thread in Java?
start()
Which of the following classes in Java represents a resizable array, similar to ArrayList but with synchronized methods?
Vector