It kind of does, but wouldn't the type-safe flaw also apply to the toArray() method that returns an array of type Object? Wouldn't that be risky too? Yet Java has that in its API. C++ does...
Type: Posts; User: GoodbyeWorld
It kind of does, but wouldn't the type-safe flaw also apply to the toArray() method that returns an array of type Object? Wouldn't that be risky too? Yet Java has that in its API. C++ does...
I can have a template class of type T in C++, just like java, but in C++ I can do this
T[] array = new T[9];
in java, if I do that, I get an error saying that I'm not allowed to use generic...