Thursday, 12 February 2015

OOP Concepts

Over this course I learned a lot of object-oriented programming concepts.

Firstly, I will talk about objects. Objects are the basic unit of object oriented programming. Objects are data and function that operate on data that are bundled as an unit.

I learned about classes also. When you define a class you define a blueprint for an object, a python class has exact specifications. Classes may contain variable definitions and methods, or subroutines that can be run by the corresponding object. To create a class you write "class NewClass():" and from there you can add methods.

The class was taught inheritance also. One of the most useful aspects of object-oriented programming is code re-usability. As the name suggests inheritance is the process of forming a new class from an existing class that is from the existing class called as base class, new class is formed called as derived class. To declare that we are extending a super class we write "class NewClass(SuperClass):" we can also add methods and attributes to specialize the class.

I found all of these concepts very interesting and fun to learn.

No comments:

Post a Comment