• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

multiple main()

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What happened when you tried it?
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic