class test
{
private static void main(String []adsf)
{
}
}
explain me that the above code is error or exception
Answers were Sorted based on User's Feedback
Answer / bhargava
Code will throw exception. Because usually every stand
alone program execution should start with main method. It
should be public other wise this method doesnt exposed to
out side to run.
| Is This Answer Correct ? | 12 Yes | 0 No |
Answer / sri
It will not generate any compile time error, but while
running the program it will generate the output as "main
method is not public".....
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / xavier
This will throw a runtime error stating main method not public
This is because main method is the starting point of program
execution and it should be accessible by JVM
| Is This Answer Correct ? | 2 Yes | 0 No |
could you run the java program without main method?
What is the difference between Synchronizing mehtod & Synchronizing block?
Are primitives objects?
What do you mean by aggregation?
1).what is the difference between below examples String s="vijay"; String s=new String("vijay");
12 Answers Mascon, Satyam, TCS,
how u do unit testing?
Are nested try statements are possible?
Tell me the difference between an applet and a Japplet?
What is an infinite loop in java? Explain with an example.
What is a super class and how super class be called?
If you do not want your class to be inherited by any other class. What would you do?
when System.out.println("") is executed what happens in the back ground?