Basic Java Interview Question and Answers
65. | What is the difference amongst JVM Spec, JVM Implementation, JVM Runtime? |
---|---|
The JVM spec is the blueprint for the JVM generated and owned by Sun. The JVM implementation is the actual implementation of the spec by a vendor and the JVM runtime is the actual running of a JVM implementation. | |
66. | What is a class loader and what are its responsibilities? |
---|---|
|
|
67. | What is the difference between instance and isInstance? |
---|---|
Instance is used to check to see if an object can be cast into a specified type without throwing a cast exception. isInstance() Determines if the specified Object is assignment compatible with the object represented by this class. This method is the dynamic equivalent of the Java language instanceof operator. The method returns true if the specified Object arguments is non null and can be cast to the reference type represented by this Class object without raising a ClassCastException. It returns false otherwise. |
|
68. | Can we call the non static variables into static methods? |
---|---|
No, vice versa is not possible. | |