Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

when we write class.forName("any one class"); what happens
actually?what it will return?explain stepwise?

Answer Posted / bharat

when we write the statement
Class.forName("fully qualified path for the class");
then the above statement will do the following things:->
1. loads the specified class (if found) in the memory otherwise throws ClassNotFoundException
2. Returns the object of type java.lang.Class corresponding to the class that was loaded ,In actual this returned object contains all properties of the class that was loaded, In technical words we will say that it is the reflection of the actual class, we can now access all the information about the loaded class with the help of this Class class object, we can now access all the data members , member methods whether they are private or public, all constructors, names of its parent classes, parent Interfaces etc with the help of this Class class object.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is stack class in java?

1004


What is the difference in between cpp and java? Can u explain in detail?

1044


What is the purpose of using javap?

1060


How many characters is 16 bytes?

956


What are the four pillars of java?

1171


Explain jvm, jre, and jdk?

966


Can we sort set in java?

918


How many bits is a word?

965


Explain some best practices you would apply while using collection in java?

993


Can we define private and protected modifiers for variables in interfaces?

1042


Explain when noclassdeffounderror will be raised ?

1006


Can we have more than one package statement in the source file?

1029


What are the wrapped, classes?

1020


What is xslt in java?

944


Is string a class in java?

941