- #1
magnifik
- 360
- 0
I am getting compilation errors in the following segment of my code:
_underlyingStorage was declared in the following way: private T[] _underlyingStorage = (T[]) new Object[128];
public T next() {
_currentIndex++;
if(_underlyingStorage[_currentIndex] == _underlyingStorage[_numElements-1])
_underlyingStorage[_currentIndex] = _underlyingStorage[0];
return _underlyingStorage[_currentIndex];
}
the error I'm getting makes no sense to me.. it says that T does not match T. what's happening here?
_underlyingStorage was declared in the following way: private T[] _underlyingStorage = (T[]) new Object[128];
public T next() {
_currentIndex++;
if(_underlyingStorage[_currentIndex] == _underlyingStorage[_numElements-1])
_underlyingStorage[_currentIndex] = _underlyingStorage[0];
return _underlyingStorage[_currentIndex];
}
the error I'm getting makes no sense to me.. it says that T does not match T. what's happening here?