In Java, how do I override the class type of a variable in an inherited class?
<p>In Java, how do I override the class type of a variable in an inherited class? For example:</p>

<pre><code>class Parent {
  protected Object results;

  public Object getResults() { ... } 
}

class Child extends parent {

  public void operation() { 
  ... need to work on results as a HashMap
  ... results.put(resultKey, resultValue);
  ... I know it is possible to cast to HashMap everytime, but is there a better way?
  }

  public HashMap getResults() {
  return results;
}
</code></pre>
