+ 3

What’s wrong with my code?

I didn’t even start coding. Getting this problem :/ https://code.sololearn.com/c78nyhPD80Lu/?ref=app

5th Aug 2019, 8:10 AM
ImmuneAG
ImmuneAG - avatar
6 Respuestas
+ 4
5th Aug 2019, 8:52 AM
Sonic
Sonic - avatar
+ 3
I see. that makes sense. thank you guys. I’m just used to c++ only needing 2 statments. check my code. is there a way to do it like that? https://code.sololearn.com/cVa04y0Xnsoe/?ref=app
5th Aug 2019, 9:27 AM
ImmuneAG
ImmuneAG - avatar
+ 2
What you pass into the println function is the Scanner object, that's why the output is weird. If you want a string, write this instead after you initialize the Scanner String s = w.nextLine(); System.out.println(s);
5th Aug 2019, 8:41 AM
Agent_I
Agent_I - avatar
+ 2
got it! thanks again :)
5th Aug 2019, 10:11 AM
ImmuneAG
ImmuneAG - avatar