list is a non-generic collection, which means any type of object is allowed to be inserted in it. But because it is a non-generic collection, it means when fetching its elements, the return type of the fetched element will be Object not the actual type of the element. Therefore, we need to cast the element to its actual type.
|
Oracle Certified Professional Java Programmer
Author:
JavaChamp TeamSenior Java Developer
QuizOver.com
Germany
Access: |