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

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?

2970


Is it possible to specify multiple jndi names when deploying an ejb?

766


What are benefits of java?

795


How can we pass argument to a function by reference instead of pass by value?

821


Why a dead thread occurs?

772


What are different types of states exist for a thread?

780


What are different access specifiers in java? Explain

834


What about abstract classes in java?

831


Can we declare register variable as global?

728


How do I run java on windows?

766


Which one will take more memory: an int or integer?

971


Difference between object and reference?

894


What is better - 'bit-shift a value' or 'multiply by 2'?

922


Can string be considered as a keyword?

793


what is the swingutilities.invokelater(runnable) method for? : Java thread

785