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
Who is the owner of java?
Can a class declared as private be accessed outside it’s package?
What is object cloning in Java?
Can I learn java without any programming experience?
What’s a deadlock?
Does string isempty check for null?
What if the main() method is declared as private? What happens when the static modifier is removed from the signature of the main() method?
What two classes are used to read data only?
Why is flag used in java?
When we should use serialization?
How do you implement singleton class?
Explain about main thread in java?
What is difference between add() and addelement() in vector?
What is stringwriter?
What is the main advantage of passing argument by reference?