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
1class Scratch{
2 public static void main(String[] args){
3 String str = "50";
4 System.out.println( Integer.parseInt( str )); // Integer.parseInt()
5 }
6}