Top "Raw-types" questions

Raw types are a feature of generics in the Java language.

What is a raw type and why shouldn't we use it?

Questions: What are raw types in Java, and why do I often hear that they shouldn't be used in new …

java generics raw-types
Implementing Comparable with a generic class

I want to define a class that implements the generic Comparable interface. While in my class I also defined a …

java generics interface comparable raw-types
Unchecked assignment warning

I am using Android Studio 1.1.0. This causes no warning: public static class A { public Map<Integer, String> getMap() { …

java generics type-erasure unchecked raw-types
Java 6: Unsupported @SuppressWarnings("rawtypes") warning

I moved to a new machine which has the latest Sun's Java compiler and noticed some warnings in the existing …

java compiler-construction warnings suppress-warnings raw-types
Java: removing "Comparable is a raw type" warning

Suppose I have a method called foo taking 2 Object as parameter. Both objects are of the same type and both …

java warnings comparable raw-types
Java generic methods in generics classes

If you create a generic class in Java (the class has generic type parameters), can you use generic methods (the …

java generics language-design generic-method raw-types
Why is Class<?> preferred to Class

If I declare a Class as a field: Class fooClass; Eclipse gives me the warning: Class is a raw type. …

java generics raw-types
How to resolve `Raw use of parameterized class 'Comparable'` warning?

Got to implement the method below for an assignment which it's subject is "WildCards", but don't know where to use …

java oop generics wildcard raw-types
Java generics: How to cast to (T extends Comparable<? super T>) without raw-types

I wonder whether it is possible to cast a non-Comparable to something so that it matches the method parameter T …

java generics casting warnings raw-types
Java - passing class with annotation to generic method

I'm working with JPA 2 and have the following method: private static void wipeTable(EntityManager em, Class<? extends Table> …

java generics annotations raw-types java-5