I've been trying to extend the ArrayList class without much success. I want to extend it, and be able to parameterize it.
So normally you have something like
ArrayList<SomeObject> list = new ArrayList<SomeObject>();
I want
MyList<SomeObject> list = new MyList<SomeObject>();
Simply extending ArrayList doesn't work.
public class MyList extends ArrayList ...
The when I try to use it I get the error
The type MyList is not generic; it cannot be parameterized with arguments <SomeObject>
I've tried variations of
public class MyList extends ArrayList<Object>
public class MyList<SubObject> extends ArrayList<Object>
with no success, If I use the subobject behind the class name it appears to work, but hides methods in the subobject class for some reason.
Any thoughts or suggestions on how to get this working right are appreciated.