bde521
asked on
passing variables as arguments in java
hi.. a number, 500, is being passed as an argument as shown:
p = r.exec(new String[] {"cmd.exe", "/k", "start", "c:\\a\\test.exe", "500"}, null, new File("c:/a"));
can this number be defined as int number and be passed as an argument.... thanks
p = r.exec(new String[] {"cmd.exe", "/k", "start", "c:\\a\\test.exe", "500"}, null, new File("c:/a"));
can this number be defined as int number and be passed as an argument.... thanks
ASKER
objects.... it works...
one question i may need to pass more than one.... could i just add it to Integer.toString as:
int n = 500;
int x = 120;
p = r.exec(new String[] {"cmd.exe", "/k", "start", "c:\\a\\test.exe", Integer.toString(n, x)}, null, new File("c:/a"));
thanks ....
one question i may need to pass more than one.... could i just add it to Integer.toString as:
int n = 500;
int x = 120;
p = r.exec(new String[] {"cmd.exe", "/k", "start", "c:\\a\\test.exe", Integer.toString(n, x)}, null, new File("c:/a"));
thanks ....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
objects.. thanks.. bde
If you want to use a int var then you could do this:
int n = 500;
p = r.exec(new String[] {"cmd.exe", "/k", "start", "c:\\a\\test.exe", Integer.toString(n)}, null, new File("c:/a"));