Thursday, June 6, 2019

Read Input from User in Java

Scanner in= new Scanner(System.in);
String s=in.nextLine();
System.out.println("String "+s);
int a=in.nextInt();
System.out.println("Integer"+a);

No comments:

Post a Comment