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
What happens when you add a double value to a string?
Why is it important to initialize a variable?
What is null in java?
Describe what happens when an object is created in java ?
Tell us something about set interface.
Is java platform independent?
why we use merge option in hybernate pls give a ex snippet
What are the rules for variable declaration?
What is the type of lambda expression?
Explain about member inner classes?
What is the preferred size of a component in java programming?
What is multiple inheritance? Is it supported by java?
Explain super keyword in java.
Why is java called java?
What about instanceof operator in java?