How can i use it with lots of lines?
like :
Code:
while(e.hasNext()){
int i = 0;
try{
i = Integer.parseInt(e.nextLine());
System.out.println("Your input is a number : "+i);
}catch (Exception ex){
String a = e.nextLine();
System.out.println("Your input is a text : "+a);
}
}
Terminal :
OBVIOUS OUTPUT I KNOW XP
Code:
90
Your input is a number : 90
omg
omgogmgomgomgomg
Your input is a text : omgogmgomgomgomg
I want something like this :
Code:
90
Your input is a number : 90
omg
Your input is a text : omg
....
how can i do that?