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
Can you sort a string in java?
What is difference between array and arraylist in java?
Where can i get Latest SUN Certification Dumps and what are the Sun Certification Codes that are available, Im new to JAVA, so please gimme info as i need to write J2EE - Core Java Certification
How java enabled high performance?
What is the access scope of a protected method?
How do you end a program?
What are the different http methods?
Can we have more than one package statement in the source file?
What is default constructors?
Explain about join() method?
What methodology can be employed to locate substrings inside a string?
I want my class to be developed in such a way that no other class (even derived class) can create its objects. Define how can I do so?
What are void pointers?
What is nextline method in java?
What are the differences between Java 1.0 and Java 2.0?