could you run the java program without main method?

Answer Posted / naga

yes,we can write and run a java program without using the
main method.
i.e By using static

example program...!

public void static( )
public class
{
public void static( )
{
System.out.println( "Without main method" );
System.exit(0);
}
}

Is This Answer Correct ?    23 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the common uses of "this" keyword in java ?

798


What is the purpose of using javap?

852


What are "methods" and "fields"?

786


What are the drawbacks of singleton class?

793


What is ascii format?

772


Explain the transient field modifier?

798


What is double word?

759


What do you mean by an object in java?

886


What is the synchronized method modifier?

872


What is split return?

695


What is ctrl m character?

754


What is final variable?

709


What is difference between static class and singleton pattern?

698


What is contractor means and methods?

781


What is the exact difference in between unicast and multicast object? Where we will use?

794