logo

Crowdly

Dado el siguiente código interface IFilter<T> { public boolean check(T ele); ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Dado el siguiente código

interface IFilter<T> { public boolean check(T ele); }

class FilterNull implements IFilter<Object> {

    public boolean check(Object ele) {    return ele!=null; }   

}

public class MyHashSet<T> extends HashSet<T>{

    private IFilter<___[1]___> filter;

    public MyHashSet (IFilter<___[2]___> filter) {

        this.filter = filter;

    }

}

¿Qué código hay que poner en los huecos [1] y [2] para permitir la siguiente declaración?

Set<Integer> myset3 = new MyHashSet<Integer>(new FilterNull());

More questions like this

Want instant access to all verified answers on moodle.uam.es?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!