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
difference between byte stream class and character stream class?
Is arraylist dynamic in java?
Why main method is called first in java?
What is blank final variable?
Is sizeof a keyword in java programming?
Which java version is latest?
Why static functions are used?
What is meant by data hiding in java?
Define how can we find the actual size of an object on the heap?
Can interface be private in java?
What is the main use of java?
What does java stand for?
What is main in java?
What is a boolean expression in java?
What are the types of java languages?