File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes What would be the command line argument be? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "What would be the command line argument be?" Watch "What would be the command line argument be?" New topic
Author

What would be the command line argument be?

Simon Joseph Aquilina
Ranch Hand

Joined: Feb 14, 2006
Posts: 102
I have created the following example in D.java



I always assumed that to run a java program both class and main method must be public. However eclipse allows me to start either D1 or D2.

What would be the command line argument to start a program from the main method in for example class D1 which is defined in the file D.java?


Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3647
    
  17

java D1
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4420
    
    8

What you'll find is that although these are both in the source file D.java, the compiled files will be D1.class and D2.class.
Simon Joseph Aquilina
Ranch Hand

Joined: Feb 14, 2006
Posts: 102
Matthew Brown wrote:What you'll find is that although these are both in the source file D.java, the compiled files will be D1.class and D2.class.


You are right, you are right!!! ... I should be ashamed of myself!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What would be the command line argument be?