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 / paras

Class.forName("")loads that class in memory ,to create
instance we have to use newInstance()

string _path="classpath loc of class XYZ ex com.aa.ss.XYZ";

Object ob=Class.forName(_path).newInstance();;
((XYZ)ob).any_method_of_XYZ();

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?

1090


when you will synchronize a piece of your code? : Java thread

1071


What are the benefits of immutable objects?

1055


Explain the difference between abstract class and interface in java?

1044


Explain importance of finally block in java?

1087


Define class?

1128


What is the purpose of the strictfp keyword?

1235


What is the significance of listiterator?

1177


Can we use synchronized block for primitives?

1127


What is the difference between an argument and a parameter?

1044


when should you use stringbuilder class in a program?

1030


What is the difference between stringbuffer and stringbuilder class?

1159


Which collections are thread safe in java?

960


How the interruptible method gets implemented?

1027


how to write a server program and sending the mails to the server using smtp protocol please help me

2114