This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes main method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "main method" Watch "main method" New topic
Author

main method

jai gurudev
Greenhorn

Joined: May 28, 2004
Posts: 20
hi,

is it possible to call main() from another method,give some example

regards

jaigurudev
Petr Blahos
Ranch Hand

Joined: Apr 28, 2004
Posts: 131
Yes, it is possible.

P.


Get a better web browser:<br /><a href="http://www.mozilla.org/products/firefox/switch.html" target="_blank" rel="nofollow">http://www.mozilla.org/products/firefox/switch.html</a>
Kj Reddy
Ranch Hand

Joined: Sep 20, 2003
Posts: 1704
I guess MMM() method should be declared as static.

Regards
Jagdish
subhit chauhan
Ranch Hand

Joined: Jun 20, 2002
Posts: 40
MMM() is a constructor !!!
iyappan sankaran
Ranch Hand

Joined: Aug 11, 2003
Posts: 58
yes,we can.

class sample
{
static
{
call();
}
public static void call()
{
main(new String[]{"hello","world"});
}
public static void main(String args[])
{
System.out.println(args[0]);
System.out.println(args[1]);
}
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: main method