0

Make this code work

Scanner a= new Scanner( system.in); String name= a.nextLine();

6th Jul 2017, 3:56 PM
Shikha Gupta
Shikha Gupta - avatar
13 Réponses
+ 12
It's giving no output just because you haven't yet tried to print the String variable 'name'. Put this at the end of your code : System.out.println(name); This is the funniest mistake ever xD
6th Jul 2017, 4:11 PM
Dev
Dev - avatar
+ 2
s of System.in should be capital
6th Jul 2017, 3:56 PM
Vaibhav Tandon
Vaibhav Tandon - avatar
+ 2
what type of error it is showing?
6th Jul 2017, 3:58 PM
Vaibhav Tandon
Vaibhav Tandon - avatar
+ 2
try this String name=a.next()+a.nextLine();
6th Jul 2017, 4:01 PM
Vaibhav Tandon
Vaibhav Tandon - avatar
+ 2
can you please post your code
6th Jul 2017, 4:07 PM
Vaibhav Tandon
Vaibhav Tandon - avatar
6th Jul 2017, 4:13 PM
Vikas Patel
Vikas Patel - avatar
0
it's not working even then try it
6th Jul 2017, 3:57 PM
Shikha Gupta
Shikha Gupta - avatar
0
it's giving no output on entering String as input
6th Jul 2017, 3:59 PM
Shikha Gupta
Shikha Gupta - avatar
0
it's giving no output again
6th Jul 2017, 4:05 PM
Shikha Gupta
Shikha Gupta - avatar
6th Jul 2017, 4:08 PM
Shikha Gupta
Shikha Gupta - avatar
0
yes!
6th Jul 2017, 4:12 PM
Vikas Patel
Vikas Patel - avatar
0
thanks i
6th Jul 2017, 4:13 PM
Shikha Gupta
Shikha Gupta - avatar
0
@Vikas Patel! Hello! Vikas constructors can not be inherited!!!
27th Nov 2017, 7:09 PM
Val🐯
Val🐯 - avatar