Question: I have some confusion about generic programming in java:

If Manager is subclass of Employee,

```
Collection<Manager> managers=new Collection<Manager>;  
Collection<Employee> employees=managers;//why illegal?

```

Why the last statement is illegal?

Since according to illustration in the book CORE JAVA,after
the erasion,`Collection<Manager>` and `Collection<Employee>` are
all converted into raw type `Collection`.

Answer: 
Just imagine your code would be legal. (Let Apple be a subclass of Fruit)

```
Collection<Fruit> apples = { new Apple() };
Collection<Apple> fruit = apples;

fruit.add(new Banana()); // Inserting a banana into a list of apples
                         // Breaks type safety

```
If you don't want to change your declaration of `employees`, you can do it like this:

```
Collection<Employee> employees=new ArrayList<Employee>(managers);

```