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
Can we convert stringbuilder to string in java?
Java.util.regex consists of which classes?
How do you convert an int to a string in java?
What are different types of encoding?
What are the common uses of "this" keyword in java ?
What is the range of a character variable?
Can we change the scope of the overridden method in the subclass?
In which language java is written?
What is tree node in java?
Tell me the latest versions in java related areas?
What is set and get methods in java?
How many arguments can a method have java?
Give the difference between the println method and sqrt method?
How do you check if a character in a string is a digit or letter?
What is java virtual machine? Explain