pardeepkumar devgon

Greenhorn
+ Follow
since Aug 23, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by pardeepkumar devgon

Just to add

1. It clarify that you are talking about a field, when there is another variable of the same name.
refer to current object as stated above
2. invoke other constructor of the current class in your parameterized constructor.
3. It can be used to return the instance of a class
4. this can also be used to refer to the outer object
Note: One point to remember is that this is associated with the instance of the class, so it will not work in static methods
11 years ago
Because interface are not supposed to have any code, that what abstract classes are for. Also interface is not a part of object hierarchy
11 years ago
When the JVM is started, three class loaders are used
Bootstrap class loader
Extensions class loader
System class loader


The bootstrap class loader loads the core Java libraries[5] located in the <JAVA_HOME>/jre/lib directory. This class loader, which is part of the core JVM, is written in native code.
The extensions class loader loads the code in the extensions directories (<JAVA_HOME>/jre/lib/ext,[6] or any other directory specified by the java.ext.dirs system property).
The system class loader loads code found on java.class.path, which maps to the system CLASSPATH variable.


In JVM, each and every class is loaded by some instanc of java.lang.classloader and its located in java.lang package and we are free to extend to add own functionality to class loading.

Whenever a new JVM started by typing "java MyClass", the "bootstrap class loader" is responsible for loading key Java classes like java.lang.Object
and other runtime code into memory first.
The runtime classes are packaged inside of the JRE\lib\rt.jar file.

Next come java extension class Loader, responsible for loading extension libraries means jar file which provide features that go beyond the core java, in the path given by the java.ext.dirs property.
The Extension Class Loader is responisble for loading all the jar files kept in java.ext.dirs path.
Developer can add his or her application jar or whatever libraries he/she might need to add to the classpath to this extension directly so the Extension Class Loader will load.

The third and foremost class loader from developer perspective is the AppClassLoader or System Class Loader responisble for loading all the classes kept in the path corresponding to java.class.path system property

jvm loads class
executes static blocks
looks for main method and invokes it
So, if there's code in a static block, it will be executed.



11 years ago