cannot find symbol - method error
The line below comes up with an error saying "cannot find symbol - method numCols".
if ((this.numCols() != rightHandSide.numCols()) || (this.numRows() != rightHandSide.numRows())){
But this method is in the code
publicint numCols()
{
return this.myCells[0].length;
}
Any help would be appreciated. Thanks.
[567 byte] By [
poseidona] at [2007-10-2 12:04:18]

> The line below comes up with an error saying "cannot
> find symbol - method numCols".
>
> if ((this.numCols() !=
> rightHandSide.numCols()) || (this.numRows() !=
> rightHandSide.numRows())) {
> But this method is in the code
>
> public int numCols()
>{
> return this.myCells[0].length;
>}
>
> Any help would be appreciated. Thanks.
It's simply that numCols() method is not a member of rightHandSide. To make it work, you should make sure that rightHandSide is an instance of the class in which numCols() is defined.