- a method of java class that is capable of constructing it own java class object. When class is having private constructor in order to create the class object outside of that class be generally use this method. We cannot execute object java.lang.class by using new keyword because this class is having only private constructor. To solve this problem use the factory method Class.forName ie, class c=Class.forName (---); Other factory method are thread t=thread.currentthread(); and calendar cl= calendar.getInstance();
No comments:
Post a Comment