Why is Class preferred to Class

Raw Types and Unbounded Wildcards None of the previous answers have really addressed why you should prefer Class<?> over Class, as on the face of it, the former seems to offer no more information than the latter. The reason is that, the raw type, i.e. Class, prevents the compiler from making generic type checks. That … Read more

Java 6: Unsupported @SuppressWarnings(“rawtypes”) warning

You can use the @SuppressWarnings(“unchecked”) which is supported by both the eclipse compiler and javac. But remember the @SuppressWarnings annotation is used by your compiler which can have its own values. The JLS only forces the compiler to understand the values “unchecked” and “deprecated” (for now). Compiler vendors should document the warning names they support … Read more