how to implement custom methods of an ArrayList in Java?
Lets suppose that I have an ArrayList defined as follows:
ArrayList<Employee> listWithItems=new ArrayList();
I was wondering if there is a way so that I can create a custom method and
call it from the ArrayList created. I mean, for example if I create a
method for computing the taxes I want to call it like this:
listWithItems.computeTaxes();
Is there a way to extend the ArrayList in Java to implement custom user
methods? I mean if there is like an ArrayList interface that I could use
it for those purposes.
Thanks
No comments:
Post a Comment