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

Define network programming?

0 Answers  


what are the steps in JDBC connectivity..???

1 Answers   IBM, SoftCom, TCS,


Why sun introduce concept of anonymous class? What is need and real life use of anonymous class

0 Answers  


What are jpa annotations?

0 Answers  


What is explicit casting?

0 Answers  


What is scrollable resultset in java?

0 Answers  


How do I enable java in firefox?

0 Answers  


Is php faster than java?

0 Answers  


What is mdb in java?

0 Answers  


What is the difference between the boolean & operator and the && operator?

0 Answers  


Java prints out a ton of digits when I system.out.println() a double. How can I format it so it displays only 3 digits after the decimal place?

0 Answers  


Which is the Best institute to do academic Project in Java? Need information about institutes at Ameerpet, Hyderabad.

8 Answers  


Categories