my keyboard inputs // first an integer and second a string
2
This is a string
my code :
import java.util.Scanner;
public class MyClass {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in) ;
int a=sc.nextInt();
//float b=sc.nextFloat();
String str=sc.nextLine();
System.out.println("###");
System.out.println(a);
// System.out.println(b);
System.out.println(str);
}
}
I am not getting two inputs . I am getting 2 only. what happened to second input ?