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 meant by inheritance and what are its advantages?
What is a pointer and does java support pointers?
Explain the differences between abstraction and encapsulation?
Convert a BST into a DLL and DLL to BST in place.
What is multithreading and its advantages?
What is finalize()? Is finalize() similar to a destructor?
How many types of variables are there?
Is array an object in java?
How do you create a first line indent?
Explain the protected field modifier?
Explain serialization and deserialization in java?
What is java english?
What is an empty class? What functionality does it offer in Java?
What is a method in coding?
Define "Access specifiers" in java.