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

Is string a datatype?

984


What is prime number in java?

995


Do loops java?

1015


describe synchronization in respect to multithreading? : Java thread

925


How to make a read-only class in java?

1161


What are the differences between heap and stack memory?

1087


Is arraylist zero based?

1066


What is a function in programming?

1042


Where is const variable stored?

934


Does java runtime require a license?

1068


What things should be kept in mind while creating your own exceptions in java?

1160


What are the three parts of a lambda expression? What is the type of lambda expression?

1032


what do you understand by synchronization? Or what is synchronization and why is it important? Or describe synchronization in respect to multithreading? Or what is synchronization? : Java thread

936


What is map java?

974


How do you join strings in java?

1049