Wednesday, May 6

Java Fundamental-II

1. What is a Marker Interface?

An interface with no methods. Example: Serializable, Remote, Cloneable

2. What interface do you implement to do the sorting?


3. What is the eligibility for a object to get cloned?

It must implement the Cloneable interface

4. 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.

5. 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.

6. 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.

7. What is the protocol used by RMI?


8. What is a hashCode?

hash code value for this object which is unique for every object.

9. What is a thread?

Thread is a block of code which can execute concurrently with other threads in the JVM.

10. What is the algorithm used in Thread scheduling?

Fixed priority scheduling.

11. What is hash-collision in Hashtable and how it is handled in Java?

Two different keys with the same hash value. Two different entries will be kept in a single hash bucket to avoid the collision.

12. What are the different driver types available in JDBC?

1. A JDBC-ODBC bridge 2. A native-API partly Java technology-enabled driver 3. A net-protocol fully Java technology-enabled driver 4. A native-protocol fully Java technology-enabled driver For more information: Driver Description

13. Is JDBC-ODBC bridge multi-threaded?


14. Does the JDBC-ODBC Bridge support multiple concurrent open statements per connection?


15. What is the use of serializable?

To persist the state of an object into any perminant storage device.

16. What is the use of transient?

It is an indicator to the JVM that those variables should not be persisted. It is the users responsibility to initialize the value when read back from the storage.

17. What are the different level lockings using the synchronization keyword?

Class level lock Object level lock Method level lock Block level lock

No comments: