|
Java Basic Sample Interview Questions - 1 |
|
|
- What is a Marker Interface? - An interface with no methods. Example: Serializable, Remote, Cloneable
- What interface do you implement to do the sorting? - Comparable
- What is the eligibility for a object to get cloned? - It must implement the Cloneable interface
- What is the purpose of abstract class? - It is not an instantiable class. It provides the concrete implementation for some/all the methods. So that they can reuse the concrete functionality by inheriting the abstract class.
- What is the difference between interface and abstract class? - Abstract class defined with methods. Interface will declare only the methods. Abstract classes are very much useful when there is a some functionality across various classes. Interfaces are well suited for the classes which varies in functionality but with the same method signatures.
- What do you mean by RMI and how it is useful? - RMI is a remote method invocation. Using RMI, you can work with remote object. The function calls are as though you are invoking a local variable. So it gives you a impression that you are working really with a object that resides within your own JVM though it is somewhere.
- What is the protocol used by RMI? - RMI-IIOP
- What is a hashCode? - hash code value for this object which is unique for every object.
- What is a thread? - Thread is a block of code which can execute concurrently with other threads in the JVM.
- What is the algorithm used in Thread scheduling? - Fixed priority scheduling.
|