top of page
搜尋
作家相片Anderson chan

About Object-Oriented Programming paradigms

Object-oriented programming(OOP) is based upon objects of programming paradigm, the four major concept of object-oriented programming are PolymorPhism, Abstraction, Encapsulation, Inheritance. Python and Java uses classes and Objects in their implementations. Everything in python is an objects, like strings, integers, functions and modules. Attributes and methods can be defined inside a class of python



Inheritance


Inheritance can ensures the codes are reused. Millions of Python and Java libraries allow programmer to reuse the code through inheritance. For example, you created a class or function called “car”, which controls a car to move, then you can create functions and method in another program that can inherit the “car” Class and you don’t need to rewrite the codes again. Especially when you work in a team, then you can use the inherit code from base class to child class. Reusability is one of the most important part of programming language. It also reduce the memory and space because it avoid some duplicate data in the program.


PolymorPhism


PolymorPhism means variables, objects and functions can exist in many forms in Python and Java. For example, A cursor can take different forms, like a line, cross or an arrow or other shapes, developer can define its attributes and behaviors with polymorphism.

Abstraction


Abstraction means to hide some data that are not related or useful, also it’s a protection to prevent access to data that are not for public. It capture the essential element of that system while suppressing other element. So it display the essential detail for the user. Encapsulation


Encapsulation is a style used to hide implementation details. The main purpose to protect your data is you won’t need to worry about you data is modify from external interference and misuse. It reduces the complexity of software development and save time when any changes.


9 次查看0 則留言

最新文章

查看全部

Comments


bottom of page