If the generics change had only changed collections, Java would have been better off adding a dynamic array type.
We must know, we will know. -- David Hilbert
Originally posted by Joseph Sweet:
Why???
We must know, we will know. -- David Hilbert
Most of the generics changes that your average Java programmer will see are in the collections API and in extending those collections. The collections become easier to use and the compiler supports typing, as we saw above. Gone are the days when you created your own collection type to hold only one type of object; generics makes that code unnecessary.
The way generics change collections is not the end of the story. Code designers will be using generics to make code more flexible in more than just collections. If the generics change had only changed collections, Java would have been better off adding a dynamic array type.
Type safe collections could have been implemented in a much more simple way, by providing a dynamic array type (i.e. an array that can dynamically resize).
We must know, we will know. -- David Hilbert
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
We must know, we will know. -- David Hilbert
We must know, we will know. -- David Hilbert
So to make those non linear collections type safe you would have to implement generics.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Think of how dumb the average person is. Mathematically, half of them are EVEN DUMBER. Smart tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|