Narayana Tutorial

Online Java Tutorial Blog

Month: December 2017

Difference between Class.forName() and newInstance() in java

Difference between Class.forName() and newInstance() in java   Class.forName()¬†returns the Class-Type for the given name. Means that it will return reference to a class and load the available all static blocks not instance methods. if you are interested only in the static block of the class , the loading the class only would do , […]

What is the difference between Static Block and Constructor placed in a class?

  What is the difference between Static Block and Constructor¬†placed in a class?   Static Block Static block of a java class executes for only one time when JVM loads the class irrespective of whether object is created for class or not and whether java class is having main method or not. So static block […]

Narayana Tutorial © 2016 Frontier Theme
Show Button
Hide Button