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

}
}

explain me that the above code is error or exception

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain inheritance in java?

798


How to stop a thread in java? Explain about sleep () method in a thread?

819


What is static import?

861


What is object in java?

779


Can we call a non-static method from inside a static method?

790


What is size_t?

754


How many types of flags are there?

751


what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread

780


What are the application of stack?

699


Can a static class have a constructor?

775


What if the main() method is declared as private? What happens when the static modifier is removed from the signature of the main() method?

960


Is list thread safe in java?

720


How to invoke external process in java.

799


What is a consumer in java?

797


What is string syntax?

834