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 java lang object?
What is difference between module and function?
How do you declare an array in java?
What are internal and external variables?
How is a variable stored in memory?
how can you take care of mutual exclusion using java threads? : Java thread
Why does java have different data types for integers and floating-point values?
What are locale settings?
What is a data structure java?
What is java util collection?
What is flush () in java?
What is instanceof keyword?
What are "class access modifiers" in Java?
What are methods and how are they defined?
How to split a string in java?