+ 1
Java bugs, again
AGAIN, MORE BUGS So my program is giving some strange error for the simplest thing Iāve ever designed: java.util.Scanner[delimiters=\p{javaWhitespace}+][position=0][match valid=false][need input=false][source closed=false][skipped=false][group separator=\x{2c}][decimal separator=\x{2e}][positive prefix=][negative prefix=\Q-\E][positive suffix=][negative suffix=][NaN string=\QNaN\E][infinity string=\Qā\E] https://code.sololearn.com/cG778c3j7n1P/?ref=app
7 Answers
+ 5
For taking input you need to write like this -
Scanner input = new Scanner(System.in) ;
int n = sc.nextInt() ;
String line = sc.nextLine() ;
String word = sc.next() ;
So on.......
Then
System.out.println(word + line) ;
the error comes because you are trying to print the object.
Edit: It is actually not an error but it is printing the object's value
+ 5
Martin Taylor ok thanks but it is only visible in the web version.
+ 3
Dallas Griffith š¤£š¤£
+ 3
Martin Taylor Well ive practiced a little bit, ive just reset EVERY course i did tho, thats why you see 0, cuz i reset them all today, i realized i need to just go through them all again, even PHP, which ive went through 3 times now ššš
+ 3
Martin Taylor bro how did you know how much xp he has in java?
+ 2
Martin Taylor Thats exactly why im going thru it again ššš
I have a problem learning programming languages easy, thats why i have to do this course like 3 times before i actually get decent. lol
+ 1
Thank you Krish ššš
Im sooo bad lol, but i used to be worse š³š (Some would think thats impossile, but belive me, i used to be. here is fhe proof: https://code.sololearn.com/wSNDn34hyUf1/?ref=app )