Originally posted by madhu v pe: Hi there is a question on generics in javabeat Code given as below public class Basket<E> { private E element; public void setElement(E x) { element = x; } public E getElement() { return element; } } class Fruit { } class Apple extends Fruit { } class Orange extends Fruit { } Which ones of the following lines can be compiled without an error? a)Basket b = new Basket(); : We can use the Raw type for the Parameterized Classes. Just like we can create the new ArrayList(), though it has type parameter. b)Basket b1 = new Basket<Fruit>(); : It is also allowed. We can create the type variable with only only on the object creation side. c)Basket<Fruit> b2 = new Basket<Fruit>(); : Allowed. The perfect parametized example. d)Basket<Apple> b3 = new Basket<Fruit>(); : Not Allowed. As the TYPE Variable on both side must be same. We can change the base reference type. Like List<T> list = new ArrayList<T>(); But, both the T parameter must be same. e)Basket<Fruit> b4 = new Basket<Apple>(); : Same reason as above f)Basket<?> b5 = new Basket<Apple>(); : Allowed. As we have can put the wild card on left side for reference declaration. g)Basket<Apple> b6 = new Basket<?>(); : Not Allowed. The wild card can be used on left side only. It can't be used for oject creation Answer is a,b,c & f how come b is valid? can anyone provide some source to clarify this Thanks