Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

program vs VM arguments

Hi,

i am looking into below program.

As in the screenshot

http://www.avajava.com/tutorials/lessons/how-do-i-set-system-properties.html?page=2

VM arguments author passing
-Dfavorite.day=Saturday -Dfavorite.car="Nissan 350Z"


My question can i pass them instead of VM arguments as program arguments text box(the one above VM arguments)
What are advantages, disadvantages of each of them.
please advise
Any links resources ideas highly appreciated. Thanks in advance
Avatar of rrz
rrz
Flag of United States of America image

Yes, you can pass them as program arguments.  
To read them you would use something like  
String  favoriteDay  = args[0];
String favoriteCar  = args[1];    
that is purposeof args[] in the line  
      public static void main(String[] args) {
Avatar of gudii9

ASKER

What are differneces, advantages, disadvantages of VM and System Arguments
I guess you read in the same web site  
http://www.avajava.com/tutorials/lessons/whats-the-difference-between-program-arguments-and-vm-arguments.html       
System arguments apply to the system.
Program arguments apply to your specific program.  
It all depends on what you trying to do.    
Hopefully an expert will have some more to say about it.
SOLUTION
Avatar of Mahesh Bhutkar
Mahesh Bhutkar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

which one is preferred to use in which case. please advise. why do we need to pass to virtual machine.what is the use case / practical use for that.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial