This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I've seen a couple of these, too ... Basically, this isn't exactly an error message, it's just a javac version 1.5.something compiler warning. Recompiling with "-Xlint:unchecked" won't make things much clearer. I did. It didn't.
As you are not dealing with a compile-time error, the warning won't keep your code from running (as long as you don't have any real errors in your code). If the chatty compiler messages keep bothering you, consider switching back to good old SDK 1.4 (if you don't need any of the additional features of Java 1.5). To do this you will have to reconfigure your IDE. If you don't use an IDE you will have to set a couple of environment variables (taking for granted you still have some SDK 1.4.something stuffed away on your system, otherwise just download and install according to instructions given for your os).
Yes, you should definitely read those links and try to learn some more about Generics. Although Steffen is right that the messages are only warnings rather than errors, generics are quite a useful tool to provide additional compile-time type safety.
Generics are a new thing in release 5.0, and if you don't use them then sometimes the compiles wags a finger at you. (No, not that finger!)
To understand generics ... well, to scrath the surface ... think of the Vector class. You used to use vectors like this:
Usually vectors (and other collections) are homogeneous. That is, even though they can contain data of all different types, they most often don't. A common bug is adding the wrong thing to the wrong collection, like adding to instead of to . Up to now, that bug has been really hard to find, because you only get symptons when you retrieve the contents of , far from the source of the bug.
With generics, you can declare that a certain vector only contains strings (or that a certain set only contains buttons, etc.). You do it like this:
Now is only allowed to contain strings. If you try to add something incompatible, the compiler will squawk. A compile-time bug is a zillion times easier to fix than a run-time bug.
Much much more on this in Chapter 8 of "Complete Java 2 Certification".
Consultant to SCJP team.<br />Co-designer of SCJD exam.<br />Co-author of "Complete Java 2 Certification Study Guide".<br />Author of "Ground-Up Java".