Understanding bit more of it

  • Eclipse: Oxygen
  • Java: 1.8

This tutorial generalizes all the tutorials studied so far in the Collections framework. If we define the type of List as Object then we are able to add all types of Objects such as the Integer, String and even some characters. Thus all the defined techniques can work except for sort which only works for elements with the same datatype.

Output

Element: Chaand
Element: Ed
Element: John
Element: Mia
Element: Some String
Element: 1
Element: 2.0
Element: #

Contributed by: Poonam Tomar


VIEW COURSES

Buy me a coffee!

 

PayTM QR (INDIA)

  • Get video tutorials
  • Project files set
  • Get┬áCertified

Leave a Reply

avatar
  Subscribe  
Notify of
Close Menu