OOP Assigment 1 Sit 1

4796 Words Nov 6th, 2013 20 Pages
Object-Oriented Programming

Software Project

National Diploma 2nd Year

TASK 1(P1) - EXPLAIN THE KEY FEATURES OF OBJECT-ORIENTED PROGRAMMING
In not less than 150 words describe the key features of object oriented programming.
The main features of OOP are:
 Inheritance
 Abstraction
 Encapsulation
 Polymorphism
Inheritance is when a class (subclass) has the same attributes and methods of another class (parent class); this is done by creating class from an existing class. While a subclass has properties derived for the parent class, it can also have properties of its own.
Abstraction is used to simplify a complex object into a more generalised concept and its basic information and function of an object. It means looking at, for
…show more content…
It also ensures that an object is dealt with and seen as a whole rather than from their individual parts. Also, since the public attributes and methods are bound to the object the interaction tends to be more method-driven while the private ones are not available for interaction outside the class. With encapsulation, the data can be either dynamically changed or bound. An example of this is the classes, where the initial methods get a value from the same class which in turn, get the value from outside the class.
With the Inheritance feature, classes which have the same basic attributes can inherit attributes from a parent class instead of re-entering the attributes. It also allows the programmer to expand on the attributes and methods that where inherited and helps make the code reusable and extendable. For example, when it comes to the application, both the 3G and 4G classes inherited from the same Smartphone class but both these classes also have options depending on the type of network.
With the Polymorphism feature, multiple methods are allowed to have the same name as long as the right one is invoked depending on the combination of parameters passed and returned from the method. This feature works alongside Inheritance as multiple objects inherit from a parent object to make ends meet with the program and return the correct type of value. An example is methods used in the classes, where there are at

More about OOP Assigment 1 Sit 1