Question 1. What Is The Purpose Of Assert Keyword Used In Jdk1.4.x?
Answer :
In order to validate certain expressions. It effectively replaces the if block and automatically throws the AssertionError on failure. This keyword should be used for the critical arguments. Meaning, without that the method does nothing.
Question 2. How Will You Get The Platform Dependent Values Like Line Separator, Path Separator, Etc., ?
Answer :
Using Sytem.getProperty(…) (line.separator, path.separator, …)
Question 3. What Is Skeleton And Stub? What Is The Purpose Of Those?
Answer :
Stub is a client side representation of the server, which takes care of communicating with the remote server. Skeleton is the server side representation. But that is no more in use… it is deprecated long before in JDK.
Question 4. What Is The Final Keyword Denotes?
Answer :
final keyword denotes that it is the final implementation for that method or variable or class. You can’t override that method/variable/class any more.
Question 5. What Is The Significance Of Listiterator?
Answer :
You can iterator back and forth.
Question 6. What Is The Major Difference Between Linkedlist And Arraylist?
Answer :
LinkedList are meant for sequential accessing. ArrayList are meant for random accessing.
Question 7. What Is Nested Class?
Answer :
If all the methods of a inner class is static then it is a nested class.
Question 8. What Is Inner Class?
Answer :
If the methods of the inner class can only be accessed via the instance of the inner class, then it is called inner class.>
Question 9. What Is Composition?
Answer :
Holding the reference of the other class within some other class is known as composition.
Question 10. What Is Aggregation?
Answer :
It is a special type of composition. If you expose all the methods of a composite class and route the method call to the composite method through its reference, then it is called aggregation.
Question 11. What Are The Methods In Object?
Answer :
clone, equals, wait, finalize, getClass, hashCode, notify, notifyAll, toString
Question 12. Can You Instantiate The Math Class?
Answer :
You can’t instantiate the math class. All the methods in this class are static. And the constructor is not public.
Question 13. What Is Singleton?
Answer :
It is one of the design pattern. This falls in the creational pattern of the design pattern. There will be only one instance for that entire JVM. You can achieve this by having the private constructor in the class.
For eg.,
public class Singleton
{
private static final Singleton s = new Singleton();
private Singleton()
{
}
public static Singleton getInstance()
{
return s;
}
// all non static methods …
}
Question 14. What Is Driver Manager?
Answer :
The basic service to manage set of JDBC drivers.
Question 15. What Is Class.forname() Does And How It Is Useful?
Answer :
It loads the class into the ClassLoader. It returns the Class. Using that you can get the instance ( “class-instance”.newInstance() ).
Question 16. What Is A Marker Interface?
Answer :
An interface with no methods.
Example: Serializable, Remote, Cloneable
Question 17. What Interface Do You Implement To Do The Sorting?
Answer :
Comparable
Question 18. What Is The Eligibility For A Object To Get Cloned?
Answer :
It must implement the Cloneable interface
Question 19. What Is The Purpose Of Abstract Class?
Answer :
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.
Question 20. What Is The Difference Between Interface And Abstract Class?
Answer :
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.
Question 21. What Do You Mean By Rmi And How It Is Useful?
Answer :
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.
Question 22. What Is The Protocol Used By Rmi?
Answer :
RMI-IIOP
Question 23. What Is A Hashcode?
Answer :
hashcode value for this object which is unique for every object.
Question 24. What Is A Thread?
Answer :
Thread is a block of code which can execute concurrently with other threads in the JVM.
Question 25. What Is The Algorithm Used In Thread Scheduling?
Answer :
Fixed priority scheduling.
Question 26. What Is Hash-collision In Hashtable And How It Is Handled In Java?
Answer :
Two different keys with the same hash value. Two different entries will be kept in a single hash bucket to avoid the collision.
Question 27. What Are The Different Driver Types Available In Jdbc?
Answer :
- A JDBC-ODBC bridge
- A native-API partly Java technology-enabled driver
- A net-protocol fully Java technology-enabled driver
- A native-protocol fully Java technology-enabled driver For more information.
Question 28. Is Jdbc-odbc Bridge Multi-threaded?
Answer :
No
Question 29. Does The Jdbc-odbc Bridge Support Multiple Concurrent Open Statements Per Connection?
Answer :
No
Question 30. What Is The Use Of Serializable?
Answer :
To persist the state of an object into any perminant storage device.
Adv Java Interview Questions
Adv Java Tutorial
J2EE Interview Questions
J2EE Tutorial
Core Java Interview Questions
JSP Interview Questions
Core Java Tutorial
Java-Springs Interview Questions
Adv Java Interview Questions
JSP Tutorial
JMS(Java Message Service) Interview Questions
Java-Springs Tutorial
Java applet Interview Questions
J2EE Interview Questions
Java Tutorial
Java Interview Questions
Java 8 Tutorial
Java 8 Interview Questions
Core Java Interview Questions
Java Programmer Interview Questions
JSP Interview Questions