How to change type of new instance runtime
<p>This is my problem</p>

<pre><code>public class Row{
  //It is just a class
}

public class RowUsedByThisClass{

  public Row someOp(Row r){
   /*I am Using this method with r a instance of Row.
    *r may be sub type of the Row. I have to inspect r and have to 
    *return a new instance. But the new instance just cant be type
    *Row it should be exact subtype r belongs.In shor i have to 
     *determin the type of return object runtime.
    *Is it possible in java? Can i use generics.
    */
  }

}
</code></pre>
