What is the difference between instanceof and isInstance?
– instanceof : It is used to check to see if an object can be cast into a specified type without throwing a cast class exception. – isInstance() : It determines if the specified...
– instanceof : It is used to check to see if an object can be cast into a specified type without throwing a cast class exception. – isInstance() : It determines if the specified...
If a method called from outside the class and it wasn’t declared static, it would have to be qualified (uselessly) with an object. Even when used within the class, there are good reasons to...
final is a modifier which can be applied to a class or a method or a variable. final class can’t be inherited, final method can’t be overridden and final variable can’t be changed. finally...
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 JVM runtime is the actual running instance...
The “JDK” is the Java Development Kit. I.e., the JDK is bundle of software that you can use to develop Java based software. The “JRE” is the Java Runtime Environment. I.e., the JRE is...
JVM is Java Virtual Machine which is a run time environment for the compiled Java class files. Java Virtual Machines operate on Java byte-code, which is normally (but not necessarily) generated from Java source...
this() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor. SuperThisDemo.java class SuperClass { int p; public SuperClass(){ System.out.println(“Super Class”); } public SuperClass(int a) {...
Below are the listed restrictions: Inherits a method from a superclass Superclass method is not final Superclass method is not private Superclass method is not static Superclass can be abstract Signature must be EXACT...
Two methods may not have the same name and argument list but different return types. MethodOverloadingDemo.java class Method123 { void meth() { System.out.println(“No parameter method”); } void meth(int n) { System.out.println(“The value of n...
The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected. Note: A class may have only one finalize method and finalizer...
Recent Comments