Delsa Delsa - 1 year ago 64
Java Question

How can I add a new method to a linked list instance?

I have declared a

and I have made a
from that

private LinkedList<ResultClass> listOfResults;

Now I want to add a new method called
getSample(Double d)
that I wish to use that like
. How can I declare a method like that in Java?

Answer Source

You'd have to create a new class for this. E.g.:

public class SamplingLinkedList<T> extends LinkedList<T> {
   public List<T> getSample(double d) {
       return // something;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download