It still compiles, just throws a warning. If you add a above main it will suppress compile time warnings that would otherwise be thrown if the string matches the type of warning, at least that's how I'm reading the language spec. It's here if you want to read more.
From what I can tell of reading both, you can't suppress warnings the spec explicitly says to throw from the compiler, you have to do it in the code with a suppression.
Edited to add, all that is if you don't parameterize. [ February 07, 2007: Message edited by: Nathan Leniz ]
The very existence of flamethrowers proves that at some time, some where, some place, someone once said to themselves "I'd really like to set those people on fire over there, but I just can't get close enough".
You can ignore those warnings. Java 5 spits them out when you write Java 4 code with a Java 5 compiler. I think there is a flag you can use when you compile to avoid that, but other than being a nuisance, it's not a problem.
try these: javac -source 1.4 javac -target 1.4
They worked for me.
If you implement Nathan's suggestion, you won't get the warnings either, but they won't compile for my 1.4 compiler (because of the '@') [ February 08, 2007: Message edited by: Marilyn de Queiroz ]
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Joined: Nov 03, 2006
Thanks both of you - I thought it was a problem with my code being wrong - I don't mind the compiler complaining, as long as I am coding in an acceptable fashion!