omit object type in the signature of an abstract method
<p>I have a Model abstract class and i want to have an abstract method to set the id of the model instances. I'd like for the implementation to define what object they would like to use for the id object though. In the following example the getId() works fine but i can't override the setId() method because the signatures aren't the same: setId(Object id) vs setId(Integer id). Can i accomplish this with the use of &lt; T > or &lt; E > or something else. I'm not familiar how to use those. </p>

<pre><code>abstract class Model{

    abstract public void setId(Object id); &lt;-- the problem

    abstract public Object getId(); 
}

class SQLiteModel extends Model{

    private Integer id;

    @Override
    public void setId(Integer id){ &lt;-- the problem
        this.id = id;
    }

    @Override
    public Integer getId(){
        return id;
    }
}
</code></pre>

<p>and what about multiple generics? </p>

<pre><code>abstract class Model&lt;T&gt; {
    abstract public void setId(T id);

    abstract public T getId();

    abstract public T getSomethingElse();
}

class SQLiteModel extends Model&lt;Integer&gt; {
    private Integer id;

    @Override
    public void setId(Integer id) {
        this.id = id;
    }

    @Override
    public Integer getId() {
        return id;
    }

    @Override
    public String getSomethingElse(){
        return "a string";
    }
}
</code></pre>
