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 a class have a static inner class?
Outline the major features of java.
What is percentage in java?
What environment variables are required to be set on a machine in order to run Java programs?
How many decimal digits is 64 bit?
What do you mean by an interface in java?
What are java threads?
What is a conditional statement explain with example?
What is the importance of hashcode() and equals() methods?
Can constructor be protected in java?
What is boolean query?
What are multiple inheritances? Is it supported by java?
I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?
How do you declare a destructor in java?
When the constructor of a class is invoked?