Java 1.8 compiler output:
MyList.java:45: error: cannot find symbol
m.add(1);
^
symbol: variable m
location: class MyList<E>
where E is a type-variable:
E extends Object declared in class MyList
1 error
I am trying to define a class MyList, which i just a wrapper around an ArrayList, no real purpose, just for the sake of learning Generics. Idea here is that I create a parameterized class, MyList<E>, which holds a parameterized instance var of type List<E>. I have an add method which adds an element of type E to the List<E>. If I create an instance of MyList, call it 'm', for some reason when I try to call a method on that instance the compiler complains that 'm' cannot be found. Any help would be greatly appreciated.
Thanks!