jQuery in Action, 2nd edition*
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 Android Security Essentials Live Lessons this week in the Android 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
 
Similar Threads
How to call a stand alone class from WAS???
First GUI program
Help with First Java Code - Party.Java
No such method? Kathy & Bert's book p. 78-79
Garbage collection problem