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...


How to load a class programmatically?



How to load a class programmatically?..

Answer / madhu

public class MainClass {

public static void main(String[] args){

ClassLoader classLoader = MainClass.class.getClassLoader();

try {
Class aClass = classLoader.loadClass("com.tech.MyClass");
System.out.println("aClass.getName() = " + aClass.getName());
} catch (ClassNotFoundException e) {
e.printStackTrace();
}

}

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More Java Related AllOther Interview Questions

What is the difference between a jdk and a jvm?

0 Answers  


What is jpa project?

0 Answers  


What are the differences between java’s old java date api and java 8’s date and time api?

0 Answers  


Is jar an executable?

0 Answers  


is hibernate a technology or framework?

4 Answers  


please suggest me final year project ideas for computer engg.on java as soon as possible becaus eo want to sumbit project name. and i am very confused.

1 Answers  


Which version of my browser should I use? : java security

0 Answers  


I run a web server. Am I at risk? : java security

0 Answers  


why is java not 100% oops?

5 Answers   IBM,


Who developed rxjava?

0 Answers  


hibernate3.jar file contain 7 dependency jar files what is that ?

1 Answers  


What is lazy loading in jpa?

0 Answers  


Categories