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
FOR EXAMPLE WE R HAVING TWO LIST ELEMENTS ..BOTH LISTS CONTAINS ID,NAME,PLACE ..I NEED TO COMPARE BOTH IDS IN TWO LISTS,IF ID'S R SAME MEANS WE HAVE ADD THE DETAILS(LIKE NAME,PLACE) TO MAP...HOW IS POSSIBLE ?CAN ANY ONE SUGGEST?
Is it possible to specify multiple jndi names when deploying an ejb?
What are benefits of java?
How can we pass argument to a function by reference instead of pass by value?
Why a dead thread occurs?
What are different types of states exist for a thread?
What are different access specifiers in java? Explain
What about abstract classes in java?
Can we declare register variable as global?
How do I run java on windows?
Which one will take more memory: an int or integer?
Difference between object and reference?
What is better - 'bit-shift a value' or 'multiply by 2'?
Can string be considered as a keyword?
what is the swingutilities.invokelater(runnable) method for? : Java thread