| December 12, 2005 18:05:49 |
#4 |
| Pardeep Saini |
Member Since: Visitor Total Comments: N/A |
RE: can we declare multiple main() methods in multiple... |
| No. We can not declare multiple main() methods as main() method is associated with the static keyword. Whenever the compilation starts compiler looks for the keyword static for compiling the program as static keyword associates with the main() method. This is the reason we need not pass any object to call the main() function. If there will be multiple main() methods then it would be difficult for the compiler to distinguish between the functions i.e to start the compilation from which main() function should be compiled first. |
| |