Newgen Previous Years Solved Sample Placement Papers
-
What is the method available for setting the priority?
A: setPriority()
Ans: setPriority() -
What is the default thread at the time of starting the program?
A: main thread
Ans: main thread -
The word synchronized can be used with only a method. True/False
A: False
Ans: False -
What are all the four states associated in the thread?
A: 1. new 2. runnable 3. blocked 4. dead
Ans: 1. new 2. runnable 3. blocked 4. dead -
The suspend() method is used to terminate a thread. True/False
A: False
Ans: False -
The run() method should necessarily exist in classes created as subclass of thread. True/False
A: True
Ans: True -
Garbage collector thread belongs to which priority?
A: low-priority
Ans: low-priority -
What is the difference between superclass & subclass?
A: A superclass is a class that is inherited whereas subclass is a class that does the inheriting.
Ans: A superclass is a class that is inherited whereas subclass is a class that does the inheriting. -
Which keyword is used to inherit a class?
A: extends
Ans: extends -
Object class is a superclass of all other classes? True/False
A: True
Ans: True -
Java supports multiple inheritance? True/False
A: False
Ans: False -
What is inheritance?
A: Deriving an object from an existing class. In other words, inheritance is the process of inheriting all the features from a class.
Ans: Deriving an object from an existing class. In other words, inheritance is the process of inheriting all the features from a class. -
What are the advantages of inheritance?
A: Reusability of code and accessibility of variables and methods of the superclass by subclasses.
Ans: Reusability of code and accessibility of variables and methods of the superclass by subclasses. -
Which methods are used to destroy the objects created by the constructor methods?
A: finalize()
Ans: finalize() -
What are abstract classes?
A: Abstract classes are those for which instances can’t be created.
Ans: Abstract classes are those for which instances can’t be created. -
What must a class do to implement an interface?
A: It must provide all of the methods in the interface and identify