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 |
What is use of a abstract variable?
What exceptions occur during serialization?
what is mean by synchronization?
3 Answers BOB Technologies, GCPL,
Why are parameters used in functions?
Which is not Object in Java?
What is the preferred size of a component?
String is a immutable objects . it means that string does not change........... But it will be chang......... { String s="kapil"; String s1="raj"; String s=s1; then print(.......) The String has been changed .. how it is possible and why its called immutable objects
What is the final keyword?
Difference between Hash Table and Hash Map?
Distinguish method overloading and method overriding
What modifiers are used with an inner class which is a member of an outerclass?
What is public static?