List down elements of an object oriented language.
Page 1 of 1
List down elements of an object oriented language.
Answer - Class
A class is a user defined data type. It serves as a template of the objects. You can define structure and behavior of an object using class. It includes data and the member functions that operate on data.
Inheritance
Inheritance enables a new class to reuse the state and behavior of old class. The new class inherits properties and methods from the old class and is called as derived class and the old class is called as base class. The methods thus inherited can be extended using overriding facility of C++.
Encapsulation
The wrapping up of data and member function into an object is called encapsulation. The data is not accessible to the outside world and only those functions which are wrapped into the object can access it. An encapsulated objects act as a "black box" for other parts of the program which interact with it. They provide a service, but the calling objects do not need to know the details how the service is accomplished.
Polymorphism
Polymorphism enables one common interface for many implementations, and for objects to act differently under different circumstances. You can also achieve polymorphism in C++ by function overloading, operator overloading and implementation inheritance.
Similar topics
» Explain object oriented programming.
» How does COM provide language transparency?
» Why PHP is also called as Scripting language?
» Why PHP is sometimes called as embedded scripting language?
» Why many companies are switching their current business language to PHP? Where PHP basically used?
» How does COM provide language transparency?
» Why PHP is also called as Scripting language?
» Why PHP is sometimes called as embedded scripting language?
» Why many companies are switching their current business language to PHP? Where PHP basically used?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|