-
Name four methods every Java class will have.
public String toString();public Object clone();public boolean equals();public int hashCode();
-
What is the Set interface
The Set interface provides methods for accessing the elements of a finite mathematicalset. Sets do notallow duplicate elements.
-
Dynamic method Dispatch
What is dynamic method dispatch?
-
What is the ResourceBundle class
The ResourceBundle class is used to store locale-specific resources that can be loaded bya program to tailor the program's appearance to the particular locale in which it is beingrun.
-
What are the Object and Class classes used for
The Object class is the highest-level class in the Java class hierarchy. The Class class isused to represent the classes and interfaces that are loaded by a Java program..
-
Can an object be garbage collected while it is still reachable
A reachable object cannot be garbage collected. Only unreachable objects may begarbage collected..
-
Java is Architectural _____________
A) DependentB) NeutralC) IndependentD) None of the above
-
What is the purpose of garbage collection
The purpose of garbage collection is to identify and discard objects that are no longerneeded by a programso that their resources may be reclaimed and reused.
-
What are three ways in which a thread can enter the waiting state
A thread can enter the waiting state by invoking its sleep() method, by blocking on I/O,by unsuccessfullyattempting to acquire an object's lock, or by invoking an object's wait() method. It canalso enter thewaiting state by invoking its (deprecated) suspend() method.
-
What is the ResourceBundle class
The ResourceBundle class is used to store locale-specific resources that can be loaded bya program totailor the program's appearance to the particular locale in which it is being run.
-
-
-
-
Can an object's finalize() method be invoked while it is reachable
An object's finalize() method cannot be invoked by the garbage collector while the objectis still reachable.However, an object's finalize() method may be invoked by other objects.
-
How are this and super used
This is used to refer to the current object instance. super is used to refer to the variablesand methods of thesuperclass of the current object instance.
-
What happens if an exception is not caught
An uncaught exception results in the uncaughtException() method of the thread'sThreadGroup beinginvoked, which eventually results in the termination of the program in which it is thrown.
-
-
Encapsulation and data abstraction in Java
Can somebody tell me what is the example of encapsulation , data abstraction & polymorphism?
-
-
Java Interview Questions
Ans