answersLogoWhite

0


Best Answer

When you start your xxxx.class it will execute its 'public static void main (String args[])' method. Any other main methods won't be executed, only if your program explicitly calls them.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write java program using two main method?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

How to write java program without using main method?

Java program without mainWe need a main method for executing a program.But YES we can write a program without using main() method.TRICK 1 of 2 :: while writing applets in java we don't use main... we use init() method instead.TRICK 2 of 2 :: using 'static' we can write a program whic will execute successfully and output the desired message on screen. Here it is :: class Mohit{ static { System.out.println("This java program has run without the main method"); System.exit(0); } } -->save the program as Mohit.java to compile::javac Mohit.java (in command prompt) to run ::java Mohit(command prompt) output will be ::This java program has run without the main methodWhoa!!!!! we are done.;)


Write a c program Fibonacci series using for loop in java?

Exactly what do you mean by 'C program in Java'


How do you write a java program to find the square root of a number?

You can use the Math.sqrt() method.


Can you run java program without applying main method?

yes we can run java program without using main. we can run program by declaring the variable static..


Write a java code to draw a circle inside in an ellipse?

write a program draw circle and ellipse by using oval methods in java


Could you write a java program that randomly generate a number plate for a car registration using the random method from Maths class eg NLF810?

yes, use for loop;;


How To write a java program to create three tier applications using servlets?

barsanabegam


Write a java application that generates two random numbers using built in method math random ranging 5 to 8 the program should use another built in method to calculate the power of xy the x value is t?

write a java application that generate custemer account balance in a banking system?


Can we add website link when we write java program?

yes ,i can add the website link in java program when we write.


Write a program in java to display a string message using Servlets?

i dont no string for servlate


Why we write java program using classes?

Classes are well organised functions in java which help discriminate between two different functions.


Jntu 2-2 oops through java answers?

write a java program to find factorial using recursive and non recursive