- #1
hotcommodity
- 436
- 0
When using GUIs, you can enter an integer or a double into an input dialog box, then you can set a variable equal to the input such as below:
int variable = Integer.parseInt(String name);
or
double variable = Double.parseDouble(String name);
If I enter a string into the dialog box, and I want to set a variable of the string type equal to that input, what code can I use that's similar to the code above? I can't seem to find anything in my textbook.
I'm looking for something like: String variable = String.parseString(String name);
Any help is appreciated.
int variable = Integer.parseInt(String name);
or
double variable = Double.parseDouble(String name);
If I enter a string into the dialog box, and I want to set a variable of the string type equal to that input, what code can I use that's similar to the code above? I can't seem to find anything in my textbook.
I'm looking for something like: String variable = String.parseString(String name);
Any help is appreciated.