Scanner sc = new Scanner(System.in);
int i = sc.nextInt(); // for integer value
byte by = sc.nextByte(); // for Byte value
String s = sc.nextLine(); // for String value
You can find other method of Scanner class .Scanner class Method
solved How to use java.util.scanner in android and java? [closed]