What is polymorphism in regards to Object Oriented Programming (OOP)? Provide an example.

The word ‘polymorphism’ literally means ‘a state of having many shapes’ or ‘the capacity to take on different forms’. When applied to object oriented programming languages like Java, it describes a language’s ability to process objects of various types and classes through a single, uniform interface. For instance, let’s consider a class Vehicle and let Car be a subclass of Vehicle. So, any Car is a Vehicle. Here, Car satisfies the IS-A relationship for its own type as well as its super class Vehicle.

Related Computing University answers

All answers ▸

What is the purpose of RAM in a computer?


Given two strings s1 and s2 return the location of each permutation of the s1 string within the s2 string.


What is inheritance in object-oriented programming?


Find a given element m in a list of n sorted numbers, with time complexity O(log(n))


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2024

Terms & Conditions|Privacy Policy