Basic Knowledge About OOP
Basic Knowledge About OOP
⚫ Case Study: Model a real world scenario ( vehicle class, fruit class, student
management in university etc.) using Object Oriented Paradigm
Software Evolution
⚫ Machine Language [ 1, 0 ]
⚫ Assembly Language
⚫ Procedure-Oriented
⚫ Object-Oriented Programming
Introduction to Procedural
Introduction to Procedural
Introduction to Procedural [
characteristics ]
⚫ Emphasis on doing the things (algorithms).
⚫ Modularity is about making building blocks, and even building blocks made
up of smaller building blocks.
Advantages of Modular
Programming
⚫ Code is easy to read
⚫ Reusability
⚫ Easier Refactoring
Limitations of Modular
Programming
⚫ Code Size
Object-Oriented Programming
Object-Oriented Programming [
characteristics ]
⚫ Functions that operated on the data of an object are tied together in the data
structure.
⚫ Objects can interact without having to know details of each other’s data or
code.
Objects
Example
class GFG {
⚫ import java.io.*; ⚫
⚫ ferrari.displaycarDetails();
⚫ class Car{ ⚫ }
⚫ String carModel; ⚫ }
⚫ String
companyName;
⚫ double carWeight;
Data Abstraction and Encapsulation
⚫ Abstraction refers to the act of representing essential features without
including the background details or explanations.
⚫ Classes use the concept of abstraction and are defined as a list of abstract
attributes such as size, weight and cost, and functions to operate on these
attributes.
⚫ The attributes are sometimes called data members because they hold
information. The functions that operate on these data are called member
functions or methods.
Data Abstraction and Encapsulation
Data Abstraction and Encapsulation
⚫ The wrapping up of data and functions into a single unit ( called class) is
known as encapsulation.
⚫ The data is not accessible to the outside world, and only those functions
which are wrapped in the class can access it.
⚫ This insulation of the data from direct access by the program is called data
hiding and information hiding
Inheritance
⚫ Inheritance is the process by which objects of one class acquire the
properties of another class. It supports the concept of hierarchical
classification.
⚫ Dynamic Binding means that the code associated with a given procedure
call is not known until the time of the call at run time.