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
1int sample2 = Integer.parseInt("47"); // returns 47
2int sample3 = Integer.parseInt("+4"); // returns 4