Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accessing the main method

 
Naufal Mohamed
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it possible to access a class's main method from another class and can a main method return a value?
if possible could anybody tell me how this is implemented.
thank you
 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why not just give it a try, remember main is static method so u can just call it using class name. and dont forget to pass String[] as argument. And it will return void.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Naufal!
is it possible to access a class's main method from another class
Yes.
can a main method return a value?
No.
could anybody tell me how this is implemented.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic