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 is parsing a sentence?
What do you understand by copy constructor in java?
what is ststic with example
How are observer and observable used in java programming?
How hashmap works in java?
What is the largest data type in java?
What are void methods?
Explain jdk, jre and jvm?
What is the primitive type short?
What is communist flag?
What is meant by 'Class access modifiers'?
What is meant by method overriding?
What is annotation in java?
Which is better stringbuilder or stringbuffer?
Is java map thread safe?