Its been a long time since I casted an array and cant remember if it can be done the way Im hoping.
I have an array of type Row (Row[] rows) that is returned from a method. The method I need to pass it into takes DataRow[] dataRows. DataRows is a child of Row.
I am trying to cast like (DataRow[]) rows when I pass in the param, but its no working.
CODE:
Row[] rows = getRows();
savetable(id, (DataRow[]) rows);
Obviously its not working for me, but is there a way to cast arrays in some similar manner?
The inheritence structure is basic:
class Row()
{
(variables/methods)
}
class DataRow extends Row()
{
(variables/methods)
}