This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

main method

 
jai gurudev
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

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

regards

jaigurudev
 
Petr Blahos
Ranch Hand
Posts: 131
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it is possible.

P.
 
Kj Reddy
Ranch Hand
Posts: 1704
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess MMM() method should be declared as static.

Regards
Jagdish
 
subhit chauhan
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MMM() is a constructor !!!
 
iyappan sankaran
Ranch Hand
Posts: 58
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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]);
}
}
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic