• Post Reply Bookmark Topic Watch Topic
  • New Topic

multiple main()  RSS feed

 
rajesh kumar rayavarapu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i have written two main()methods in a class,It's is compiled properly or not?pls see below exp


class demo
{
...........
............
Line 1: public static void main(String arg[])
{
.... i have written some code..........
...........................
}
Line 2 ublic static void main(String arg[])
{
......... i have written some code.........
.............................
}

In the above program i have written two main() methods.It executed or not
If it is not executed what type of error i have get.
If it is executed second method(Line 2) code is executed?

pls give the response naa
thanks,
rajesh.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happened when you tried it?
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rajesh kumar rayavarapu:
...It's is compiled properly or not? ...

As a convenience, Sun has provided a compiler called javac. It's as easy to use as posting code here, and often provides better, faster answers.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!