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

How do I find jre version?

0 Answers  


What is the use of servlet in java?

0 Answers  


when a program class implements an interface it must provide behavior for..?

1 Answers  


Can the main method be overloaded?

0 Answers  


What is jndi datasource in java?

0 Answers  


Is jdk an ide?

0 Answers  


What is default constructor in java?

0 Answers  


Who developed rxjava?

0 Answers  


Are jvm’s platform independent?

0 Answers  


How do you count in java?

0 Answers  


What is lambda expressions action func and predicate?

0 Answers  


What is http session in java?

0 Answers  


Categories