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

Define jit compiler?

1116


What are the two types of java programming?

1041


What are the differences between processes and threads?

1044


Give us a program to check for parenthesis matching using stack.

987


Can inner class final?

1079


What is __ init __ functions?

1093


What is a map? What are the implementations of map?

1076


Differentiate between stringbuffer and stringbuilder in java.

1004


Is null in java?

984


What do you mean by synchronized non access modifier?

979


What is the use of jtable?

1103


How to sort array in descending order in java?

912


What are the steps involved to write rmi based programs?

998


Define reflection.

975


What is meant by null and void?

953