Tim Cooke wrote:Are you sure it's an actual error from the compiler? And not just a recommendation / suggestion from your IDE?
Knute Snortum wrote:A note on your post: If you UseCodeTags (that's a link) you won't lose the nice formatting of your code:
Looks better, huh?
Tim Cooke wrote:Where exactly do you see that error?
Tim Cooke wrote:Right, so you're seeing it in your IDE. Eclipse, or IntelliJ, or some other.
Like I said, are you sure it's an error? I propose that it's just your IDE giving you a suggestion. I have run your code using just a terminal and the javac command with no error or warning.
It is recommended that when starting out with java programming that you do not jump straight in to using and IDE and keep it simple by using the command line tools. That way you really learn what errors and messages are coming from the compiler and what messages are just IDE sugar. Don't get me wrong, IDE's are a great tool and are hugely useful but it's extremely important to understand what the IDE is doing for you first.
Does that all make sense?
Knute Snortum wrote:Even with people like me, who don't think it's a bad idea to learn an IDE as you learn Java, I still believe that knowing how to run from the command line is essential. All you need is a JDK and a text editter (like Notepad++ on windows or vim on Linux).
Here is a wiki page that will get you started.
Knute Snortum wrote:All you need is a JDK and a text editter (like Notepad++ on windows or vim on Linux).
Randy Maddocks wrote:Hope this helps. Cheers.