I'm just wondering, in a Collection of objects, how do you get objects back out in the same type that they went in? Just like in an array where you access it by the a[10].
In the List interface, the get() method returns an Object, not the original type that went in. The Map get() does the same thing when you give it a key as a parameter.
Do you have to convert the collection to an array using toArray() to access the elements?
Thanks!
In the List interface, the get() method returns an Object, not the original type that went in. The Map get() does the same thing when you give it a key as a parameter.
Do you have to convert the collection to an array using toArray() to access the elements?
Thanks!