I've been working in Eclipse on a class that holds a collection of objects in a 2D array. To enable generic types, I make casts between Object and E when initializing my array in my constructor:
The thing is I get a warning when I initialize my grid array saying "Type safety: The cast from Object[][] to E[][] is actually checking against the erased type Object[][]." It's not an error; just an Eclipse warning. Should I worry/care about this?Code:class HexArray<E> { private E[][] grid; public HexArray(int rowSize, int colSize) { grid = (E[][])new Object[row][col]; ... } ... }


Reply With Quote


Bookmarks