String str = "123"; int value = Integer.parseInt(String.valueOf(str)); int var = Integer.parseInt(str);