0

Why does Scanner behave in such a strange way?

When ever I take input for an integer followed by string ,it never takes it?

like for example

Scanner s=new Scanner(System.in);
int i=s.nextInt();
String str=s.nextLine();
String str2=s.nextLine();

We can never input a value for a string str,it straightways go to str2?why so?

0 Answers0