Object-Oriented Programming: Understanding the Basics and Concepts - Prof. Nguyen, Assignments of Parallel Computing and Programming

An introduction to Object-Oriented Programming (OOP), a fundamental programming paradigm that utilizes classes and objects to create reusable code blueprints. OOP offers benefits such as encapsulation, inheritance, polymorphism, and complex modeling. Learn about objects, classes, and their components, as well as the characteristics and relationships between classes.

Typology: Assignments

2020/2021

Uploaded on 06/22/2021

vu-thi-huong-fgw-dn
vu-thi-huong-fgw-dn 🇻🇳

2 documents

1 / 12

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ADVANCED
PROGRAMMING
TRAN HUU VIET DUC
GCD19794
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Object-Oriented Programming: Understanding the Basics and Concepts - Prof. Nguyen and more Assignments Parallel Computing and Programming in PDF only on Docsity!

ADVANCED

PROGRAMMING

TRAN HUU VIET DUC

GCD

Introduce about OPP

 (^) Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has utilized at some time in their career. The most common programming paradigm is object-oriented programming (OOP), which is taught as the conventional method to write for the majority of a programmer's school career.

Benefits of OOP

 (^) Complex things are modeled as repeatable, basic structures in OOP.  (^) OOP objects are reusable and may be utilized in several programs.  (^) Polymorphism allows for class-specific behavior.  (^) Classes are easier to debug since they frequently include all relevant information.  (^) Encapsulation secures and safeguards information.

Concepts of OOP

Objects  (^) It represents real-life entities and is a fundamental unit of Object-Oriented Programming. A Class's instance is an Object. When a class is declared, no memory is allocated; nevertheless, memory is allocated when it is instantiated (that is, when an object is formed). An item has a name, a state, and a personality. Each object contains data as well as code for manipulating it. Objects can communicate without knowing anything about each other's data or code; all they need to know is the type of message they take and the sort of answer they provide.  (^) Objects in OOP consist of 2 main components:  (^) Attribute: is the information, characteristics of the object  (^) Methods: are behaviors and objects that can perform. Class  (^) The object is abstracted into a class. A class is a collection of objects with similar characteristics. There will also be two bits of information in the class: properties and methods. An object will be regarded a class instance. An object will be considered an instance of the class.  (^) Continuing the example in the object section above, we have a smartphone class consisting of 2 components:  (^) Attributes: color, memory, operating system…  (^) Methods: calling, taking photos, texting, recording...

Encapsulation

 (^) Encapsulation means that a class's variables or data are concealed from other classes and can only be accessible through member functions of the class in which it is stated.

Inheritance

 (^) Inheritance is a notion in which parent and child classes are defined. As a result, it's the technique that allows one class to inherit the characteristics (fields and methods) of another. Reusability is provided through inheritance. Reusability may be defined as the ability to create a new class by reusing the properties of an existing one.

Abstraction

 (^) Abstraction is a notion in object-oriented programming that "shows" just the most important properties while "hiding" the rest. The fundamental goal of abstraction is to keep people away from needless information. Abstraction is the process of choosing data from a bigger pool in order to display the user only the relevant features of an item. It aids in the reduction of programming labor and complexity. It is one of the most crucial OOP principles.

Relationships between classes