In an attempt to see if I can clean up some of my math code, mostly matrix stuff, I am trying to use some Java Generics. I have the following method:
private <
Java's use of erasure to implement generics means that you're going to have trouble new'ing a generic type.
How about using null to represent 0
retVal[i][j] = null;
You can then assign any type you want to the array later on.