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


Please Help Members By Posting Answers For Below Questions

What kind of variables can a class consist?

831


What do you mean by exception handling in Java?

1017


What is += mean in java?

796


Write a function for palindrome and factorial and explain?

886


How thread scheduler schedule the task?

837


What is a platform?

767


Give example to differentiate between call by value and call by reference.

822


Which java collection does not allow null?

928


Does java return by reference?

779


What are the drawbacks for singleton class?

780


Can we assign integer value to char in java?

744


What is a percentage sign called?

842


How are destructors defined in java?

823


What is vector?

798


What is anagram in java?

738