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
Why are arrays useful in java?
Can we write method inside a method in java?
Why are there no global variables in java?
What are the differences between graph and tree?
What are pass by reference and pass by value?
What is adapter in java?
What is local class in java?
What is Mutex (Mutual Exclusion Object) ?
What are the parts of a method?
What is arrays sort in java?
What is a java object and java application?
What is boolean flag in java?
What is string length in java?
Explain numeric promotion?
What exceptions occur during serialization?