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

class A
{
class B
{
psvm(String args[])
{
}
}
}
if the prg saved in A.java whats the o/p?

Answer Posted / sivadasan

The above code will be compiled succcessfully.

but at runtime it will throw an exception :

Exception in thread "main" java.lang.NoSuchMethodError: main

Because, Java Environment starts its execution from main
method. That method must be declared in the class which is
we are using to save our code.

If any query let me know....

Is This Answer Correct ?    2 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by inheritance and what are its advantages?

1091


What is a pointer and does java support pointers?

993


Explain the differences between abstraction and encapsulation?

1046


Convert a BST into a DLL and DLL to BST in place.

1109


What is multithreading and its advantages?

1064


What is finalize()? Is finalize() similar to a destructor?

961


How many types of variables are there?

1118


Is array an object in java?

948


How do you create a first line indent?

994


Explain the protected field modifier?

1075


Explain serialization and deserialization in java?

995


What is java english?

983


What is an empty class? What functionality does it offer in Java?

1263


What is a method in coding?

1046


Define "Access specifiers" in java.

1158