PDA

Click to See Complete Forum and Search --> : DOS help.


syrillia
May 30th, 2009, 12:17 PM
I'm using a DOS command to run a program (not written in java). How can I use another DOS command to retrieve the value of a string inside a class file.

Inside the class file I have:

public static String thestring = "string value.";

How can I use a dos command to echo that string.

echo &thestring%

manavo11
May 30th, 2009, 04:02 PM
You mean print the value of the variable to the DOS window from within Java? If so, use System.out.println(variableName);

Or "print" instead of "println" to not have a new line character at the end.