class test
{
private static void main(String []adsf)
{
}
}
explain me that the above code is error or exception
Answer Posted / 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 |
Post New Answer View All Answers
What is the purpose of static methods and static variables?
What is the memory leak in java?
What is the final method?
Can a constructor be made final?
What are operators and its types?
What is the main difference between java platform and other platforms?
What data type is a string?
What is a values collection view ?
How can you handle java exceptions?
What is the static import?
Is space a character in java?
Is null a string or object in java?
What is string example?
What is javac used for?
Variable of the boolean type is automatically initialized as?