+ 2
Where have I messed up? *Solved*
Lads, I've been banging my head against a wall (for an embaracingly long time) trying to figure out where I've messed up. In case you don't get the gist of my very basic code I'm just doing a simple check to see if the person is 18 or over. Any help would be much appreciated, Thanks in advance! https://code.sololearn.com/cTovZ19MujPG/?ref=app
5 Answers
+ 10
Hey @Robert, Java is a case sensitive language, meaning, it is important to pay attention at how Syntax is written, your primary issue is related to System being written as system, and Scanner as scanner, if you changed all the occurrence of those keywords your code will work, now go give it a try mate : )
+ 5
@Robert great!, but I guess that's how Code Playground and most online code processors work inevitably : )
Don't get too annoyed, it's common mistake for a start, not bad at all, just keep going mate, you'll be fine : )
+ 3
@Ipang Yep, worked (although the fact that the user needs to put in their input before the code runs is a little annoying!) Thank you for your help, only now I'm not sure if I'm more or less annoyed that it was such a simple fix đ
Also thanks to @Jente you would have also fixed it with your suggestions (although I didn't use the "java.util.*" as it worked fine without it but I'll check now to see if that works too).
+ 2
you've imported the wrong package, it's java.util.*
also capitalize all the words "scanner" and "system" normally that should work :p
0
good