Define the following with an example :- an object
a class
inheritance
polymorphism
Answers
Answer:
Object is a unique entity, which contains data and functions that is characteristics and behaviours together in an object oriented programming language.
Eg- object: table. characteristics: four legs and a plain platform.
Class is a prototype of an object which contains all fundamental data types like byte, short, int, long, float, double, char and boolean.
Eg- Rainbow as a class which has different colours like violet, indigo, green can be referred as its objects.
Inheritance is the process by which objects of one class can link and share some common properties of objects from another class.
Eg- The figure circle is a part of the class two-dimentional, which in turn is a part of the class mensuration.
Polymorphism is the process of using a function for more than one purpose.