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 How do you call 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 "How do you call "Static Void Main ( String [] args )?" Watch "How do you call "Static Void Main ( String [] args )?" New topic
Author

How do you call "Static Void Main ( String [] args )?

John Quach
Ranch Hand

Joined: Sep 28, 2011
Posts: 50
I know Static methods can be accessed by any class.... but I can't wrap my head around this.



This method appears usually on a client class. Can it be called?
John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
Yes... use [Classname].man(). Did you make a typo? Should it be main() instead? Why are you worrying about only this static method? Aren't you seeing this method called anywhere in the code?
John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
Please read - The Main Method
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

The main method is just a method, exactly the same as any other method - there's nothing "magical" about it. You can call it just like you would call any other static method:


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38082
    
  22
Jesper de Jong wrote: . . . You can call it just like you would call any other static method:
And here is a different version of Jesper’s example:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do you call "Static Void Main ( String [] args )?
 
Similar Threads
Java Object Oriented Grades Program
simple main function doubt
try again
Inner class
Help