File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Accessing the 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 "Accessing the main method " Watch "Accessing the main method " New topic
Author

Accessing the main method

Naufal Mohamed
Greenhorn

Joined: Jan 14, 2003
Posts: 5
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

Joined: Sep 28, 2002
Posts: 452
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.


Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
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.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing the main method
 
Similar Threads
main in multiple classes
is it possible 2 call a main method
java
how to run a normal java program without main method
JVM memeory allocation