answersLogoWhite

0

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

15y ago

What else can I help you with?

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;;


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?


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

barsanabegam


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


What will happen if a Java Class has no Main Method?

Nothing will happen. There is no restriction that every Java class must have a main method. The only program is that, this class cannot be executed as a standalone java program.


How do you write program in java?

You can write it with Windows NotePad, although using an IDE such as NetBeans or Eclipse is recommended. If you mean you want to learn Java, take a look at the tutorials at the Oracle site.


Can you write java program in Microsoft Word?

Since the Java program is basically a text file, you can write it in any text editor (although using a Java IDE, or an IDE with support for Java, does give you certain advantages). Thus, you can use programs such as NotePad or NotePad++ to write the Java program. Using word processors such as MS-Word is problematic, because these insert additional codes. You would have to make sure you save the resulting file in the text format - give the "Save As" command, and choose a text format from the list.


Write a Java Program to find occurences of given word in a text?

Check the documentation of the String class, for a method that searches for a substring.


Write a program to find gcd using recursive method in java?

for two positive integers: public static int gcd(int i1, int i2) { // using Euclid's algorithm int a=i1, b=i2, temp; while (b!=0) { temp=b; b=a%temp; a=temp; } return a; }


How do you write a java program with xcode4?

You are best off looking into downloading an IDE such as Eclipse or netbeans, as they are tailored towards development using the Java programming language.


What is the executable method in java?

In Java, the executable method is the main method, which serves as the entry point for any standalone Java application. It is defined as public static void main(String[] args), where String[] args allows for command-line arguments to be passed to the program. The main method must be declared as public and static, and it returns no value (void). When a Java program is run, the Java Virtual Machine (JVM) looks for this method to start the execution of the program.


How do you write program in jdk?

JDK stands for Java Development Kit. It is not a programming language. It is a the system using which you can develop programs in Java. You need to have jdk installed in your machine to create java programs.