To look at the problem another way, generally the issue is we have a socket interface which accepts only 1 type of plug object! Sockets are not polymorphic. The solution most people take is to buy a universal plug adapter. Some have 2 pins, some have 3 pins, some pins are circular, some pins are rectangular, and the configuration of the pins vary. Photo by Call Me Fredīizarrely, there are approximately 16 different types of electrical sockets worldwide. Otherwise, you may not be able to charge your phone and other devices. If you have ever travelled internationally, one item on your packing checklist is likely to be an electrical plug adapter. Let's explain what we mean by this exactly. Polymorphism literally means “ many forms”. This reduces duplication of code when you want the same actions to be performed on different types of objects. Polymorphism allows objects to be treated in a substitutable way.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |