This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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: 4087
    
  18

java D1


The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4541
    
    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?
 
It's not a secret anymore!