I have a genericised class that I wish to subclass as follows:
public class SomeTable<T extends BaseTableEntry>
extends BaseTable<T>
{
public SomeTable(int rows, int cols)
{
super(rows, cols, SomeTableEntry.class);
//Does not compile:
//Cannot find symbol: constructor BaseTable(int, int, java.lang.Class<blah.blah.SomeTableEntry.class>)
}
}
... where the genericised superclass is:
public class BaseTable<T extends BaseTableEntry>
{
public BaseTable(int rows, int cols, Class<T> clasz)
{
...
}
...
}
I understand the compiler error, but cannot seem to find a workaround, other than to include an extra parameter in the SomeTable
constructor.
Any suggestions?
Thanks!
SomeTable
does not need to be genericised,public class SomeTable extends BaseTable<SomeTableEntry>
is fine. – Erubescence