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.
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.;)
yes we can run java program without using main. we can run program by declaring the variable static..
write a program draw circle and ellipse by using oval methods in java
yes, use for loop;;
write a java application that generate custemer account balance in a banking system?
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.;)
Exactly what do you mean by 'C program in Java'
You can use the Math.sqrt() method.
yes we can run java program without using main. we can run program by declaring the variable static..
write a program draw circle and ellipse by using oval methods in java
yes, use for loop;;
barsanabegam
write a java application that generate custemer account balance in a banking system?
yes ,i can add the website link in java program when we write.
i dont no string for servlate
Classes are well organised functions in java which help discriminate between two different functions.
write a java program to find factorial using recursive and non recursive