boolean function returns integer or does not recognize

0

I have this boolean function:

    public boolean remove(T elem){
    boolean ezabatu = false;
    if (this.first.equals(elem)){
        this.removeFirst();
        ezabatu = true;
    }else{
        while (this.actual.next!=null && !ezabatu){
            if(this.actual.next.equals(elem)){
                this.remove();
                ezabatu = true;
            }
            this.actual = this.actual.next;
        }
    }
    this.actual = this.first;
    return ezabatu;
}

and I use it here:

int elem = teklatu.nextInt();
    if(osokoLista.remove(elem)){
        System.out.println(...);
    }else{
        System.out.println(...);
}

in the if I get the error "can not convert from Integer to boolean" and I do not understand why

    
asked by Unknown 01.10.2016 в 19:37
source

0 answers