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


Please Help Members By Posting Answers For Below Questions

difference between byte stream class and character stream class?

4318


Is arraylist dynamic in java?

734


Why main method is called first in java?

763


What is blank final variable?

811


Is sizeof a keyword in java programming?

832


Which java version is latest?

758


Why static functions are used?

813


What is meant by data hiding in java?

875


Define how can we find the actual size of an object on the heap?

913


Can interface be private in java?

774


What is the main use of java?

853


What does java stand for?

798


What is main in java?

803


What is a boolean expression in java?

785


What are the types of java languages?

743