1int result = Integer.parseInt("500");
2System.out.println(result) // prints 500 as int
1 String number = "10";
2 int result = Integer.parseInt(number);
3 System.out.println(result);
4Copy
1String toBeParsed = "15";
2int parsedString = Integer.parseInt(String.valueOf(toBeParsed));
3/*this makes the integer value of parsedString the number held
4in the string toBeParsed*/
5/*Side note: you will have to import java.lang.String to be
6able to use Integer.parseInt() and String.valeOf() */