0

why this code is not working proper? I am not able to take input from the keyboardl.

import java.util.Scanner; class India { public static void main(String[] args) { System.out.println("Hello Codiva"); Scanner sc=new Scanner(System.in); String name=sc.nextLine(); System.out.println("MY name is "+name); } }

22nd Oct 2020, 2:01 AM
Abhishek Kumar
Abhishek Kumar - avatar
3 Answers
0
Are you sure is not working? When posting code, write it and post link, better to test. But I see all and all right. You imported, declared, assigned... All right. Should work.
22nd Oct 2020, 3:10 AM
Marcelo Anjos
Marcelo Anjos - avatar
0
But not taking input from keyboard
22nd Oct 2020, 4:08 AM
Abhishek Kumar
Abhishek Kumar - avatar
0
Testing where? Because on SoloLearn need declare ALL input before program runs.
22nd Oct 2020, 4:10 AM
Marcelo Anjos
Marcelo Anjos - avatar