JVM : JVM is an abstract machine where java byte codes can be implemented.
JRE : It is an implementation of JVM and physically exists.
JDK : JRE + Development Tools
JIT : Instruction set of JVM to Instruction set of CPU. It compiles similar code at the same time, so faster than other compilers.
Object based programming language: JavaScript and VBScript are object based programming language.
Static variable: It provides only one instance of the variable per JVM.
Static Method: It can be invoked without creating an object to the class and can access static variables.
Main method is static A main method is static because it needs to be called without an object.
Substitute for main method We can use a static block like, Class A{ Static {}}.
Final Final variable – constant variable value Final method – Cannot be overridden Final class – Cannot be inherited
Abstract Class: It is a class that needs to be extended and cannot be implemented.
Abstract and final Abstract and final cannot exist together.
Interface Interface has method definitions and provides abstraction and multiple inheritances.
Interface cannot be static and final
Abstract VS Interface Method body can be present - only abstract methods. Variables - no variables Can have constructor – No Static methods – no You can extend abstract classes – you can implement multiple interfaces.
Composition Using another class inside the class without inheriting it is composition.
Virtual Functions All functions in java are virtual functions.
Immutable Once value is assigned it cannot be changed. String is immutable.
Immutable Once value is assigned it cannot be changed. String is immutable.
Reflection It is modifying runtime behavior of a class at runtime. EG: Debugger, Eclipse, Testing tools.
Wrapper Classes They allow primitive times to be accessed as objects.
Singleton Class It has one instance per JVM only.
Base class for error and exception Throwable.
No comments:
Post a Comment