class test
{
private static void main(String []adsf)
{

}
}

explain me that the above code is error or exception

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between process and thread?

815


What is a parameter used for?

723


State some situations where exceptions may arise in java?

832


Can subclass overriding method declare an exception if parent class method doesn't throw an exception?

746


Explain enumeration in java?

773


Why does my function print none?

718


How many JVMs can run on a single machine and what is the Just-In-Time(JIT) compiler?

811


What is a war file?

750


How do you add an element to a set in java?

763


Difference between static synchronization vs. Instance synchronization?

819


Explain the usage of this with constructors?

749


How can you make sure that your singleton class will always return single instance in multi-threaded environment?

779


How can constructor chaining be done using this keyword?

925


What happens when a thrown exception is not handled?

774


What is the major advantage of external iteration over internal iteration?

824