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 the base class in java from which all classes are derived?
What is a finally block? Is there a case when finally will not execute?
What is the use of bufferedreader?
What are the data types supported by java?
How do you allocate memory to object?
Which is better singleton or static class?
how does multithreading take place on a computer with a single cpu? : Java thread
What is finalize method?
What is the use of singleton class?
Is a class an object?
How are this() and super() used with constructors in java programming?
how to create multithreaded program? : Java thread
What is palindrome in java?
What is an example of a keyword?
Is arraylist an object in java?