Chapter 16 - Exercise 9

(3) Create the classes necessary for the Peel example and show that the compiler doesn’t accept it. Fix the problem using an ArrayList.




class Peel<T>{}

class Banana{}

public class Exercise9{
    public static void main(String[] args){
        //Peel<Banana>[] pb=new Peel<Banana>[10];
        ArrayList<Peel<Banana>> apb=new ArrayList<Peel<Banana>>();
    }
}



Need Java Developers? Hire Me »

I know Java. Talk is cheap, watch my code.

I live in CANADA now.