import java.util.Scanner;
public class IntToStrMethodsDemo {
public static void
main(String[] args) {
int num;
num=readInt();
String
str=intToStr(num);
System.out.println(intToStr(num)+1);
}
public static int
readInt(){
System.out.println("enter an int");
return new
Scanner(System.in).nextInt();
}
public static
String intToStr(int num){
return
""+num;
}
}
Or use the code below :
String str = ""+new Scanner(System.in).nextInt();
System.out.println(str+1);
It does the same