No, a program may not work with two main methods. If we preferred with working with many packages means then each package may consist of a 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.;)
No you can't. main() is the entry point of a C program where execution starts. Only a single main() can exist in a C program. A program with 2 mains wil not even compile successfully.
The entry point of a C program is the main function.The function signature might be like one of these:1. int main (void)2. int main (int argc, char *argv[])
You cannot. A C program can only have one global main function but you'd be trying to compile a program that has two main functions. The only way to merge the two programs is to modularise both programs so that neither is dependent upon their main functions. Once modularised, you can include those modules in any program. Alternatively, you can create binary libraries from the modules and link them into any program.
In Unix, with a C program you can run a quick function to do this. There is an example at:(link moved to link section)AnswerIn Solaris, you need to disconnect your program from your "terminal" ( scripts generally inherit the stdin, stdout, and stderr of your shell when you execute them ). For a shell program you can execute "nohup $program < /dev/null > /dev/null 2>&1 &". Or the shell program can redirect its own stdin, stdout, and stderr -- then you can execute "nohup $program &".
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.;)
Sexual and asexual reproduction.
No you can't. main() is the entry point of a C program where execution starts. Only a single main() can exist in a C program. A program with 2 mains wil not even compile successfully.
#include <stdio.h> int main (void) { puts ("4"); return 0; }
No. There currently isn't a emulator program that will run on an unmodified Playstation 2
in world war 2
The entry point of a C program is the main function.The function signature might be like one of these:1. int main (void)2. int main (int argc, char *argv[])
The main 2 questions you must ask yourself are; 1.Can my PC run it? 2.Can it run what want to use?
1.Declaration of header files. 2.void main()/main() 3.delcaration of the variable. 4.Printf&scanf statement. 5.execution. 6.result
Well, a main point is obvious, it's renewable. Fossil fuels, although abundant, have a limited supply; eventually they'll run out. Also, though all methods for harnessing energy have their own environmental effects, renewable energies tend to be less harmful than currently used methods.
1-upgrade 2-clean boot 3-dual boot
1. compilation errors 2. run time errors