wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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: 3605
    
  14

java D1
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4344
    
    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?
 
Similar Threads
What is the output and Why
Issue adding double value
Question on Pass By Reference
static method
Date Format related