class A
{
class B
{
psvm(String args[])
{
}
}
}
if the prg saved in A.java whats the o/p?
Answer Posted / hitesh kumar
Compilation error:-
The method main cannot be declared static; static methods
can only be declared in a static or top level type.
To make it happen you need to declare class B as static
class A{
static class B{
psvm(String arg[]){}
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is object-oriented programming?
Which is better arraylist or vector?
What do you mean by garbage collection used in java?
What is a blocking method in Java?
Is java se open source?
What is difference between calling start() and run() method of thread?
In the below example, what will be the output?
What are streams in java 8?
How can an exception be thrown manually by a programmer?
What is the difference between class & structure?
What does java ide mean?
What are packages in java?
How will you call an Applet using Java Script Function?
What is the use of generics? When was it added to the Java development Kit?
What is tcp ip in java?