public class StringToInt { public static void main(String[] args) { String str = "123"; int number = Integer.parseInt(str); // String to int System.out.println("Converted number: " + number); } }