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 happens when you add a double value to a string?

1056


Why is it important to initialize a variable?

1041


What is null in java?

1025


Describe what happens when an object is created in java ?

1068


Tell us something about set interface.

1067


Is java platform independent?

1024


why we use merge option in hybernate pls give a ex snippet

2030


What are the rules for variable declaration?

1010


What is the type of lambda expression?

1087


Explain about member inner classes?

1156


What is the preferred size of a component in java programming?

1046


What is multiple inheritance? Is it supported by java?

1015


Explain super keyword in java.

1076


Why is java called java?

1102


What about instanceof operator in java?

1066