Object-Oriented Programming (OOP) is one
of the programming paradigms. OOP is based on ‘’object’’, which means object is
the initial parameter in programming. All the functions and algorithms are
created according to the object.
It may seem a little bit abstract. Let’s see
an example. As for the volume of a cuboid, all the cuboids have height, width
and length. As a result, for any cuboid, the volume can be indicated as
height*width*length. In this particular case, the ‘’object’’ is cuboid, no
matter what kind of cuboid it is, the volume could be calculated by this
function.
Consequently, ‘’class ’’ plays a significant
role in OOP languages. A class include all pf the functions and algorithms or
the same object. The class have various
methods for the object. Take List for an instance. List is an important class
in Python, indicated as […]. In class List, we have append, pop, remove and so
on methods, which are oriented to List.
Besides, subclass is also produced in OOP
language. Subclass is the posterity of a particular class. However, subclass is
designed for a more specific object, comparing with a general class. Subclass inherits
the properties of the general class. At the same time, subclass has its own distinctive
properties.
So far, Python is the only programming
language that I have learnt. As a typical OOP language, the impressions that Python
leaves me are its efficiency, flexibility and expansibility. Everything in
Python is about object. Objects decide the functions and algorithms. This is what OOP is.

No comments:
Post a Comment