@SuppressWarnings("unchecked")
protected final <ArrayType> ArrayType[] getArray(Class<ArrayType> arrayType, int size) {
return (ArrayType[]) Array.newInstance(arrayType, size);
}
Ridicules isn't it...?
My architecture for a long time was lacking because I was missing this info, and in combination with this post, it makes Generics the most useful feature while designing an application architecture.
No comments:
Post a Comment