SlideShare a Scribd company logo
CHAPTER 1
INTRODUCTION TO THE OOP
PARADIGM
Introduction
• Object Oriented Programming (OOP)
• Structured Programming
• Programming paradigm is a fundamental style of computer
programming
• Object Oriented Programming (OOP)
• Structured Programming
• Programming paradigm is a fundamental style of computer
programming
Introduction
• Programming paradigms differ in how each element of the
programs is represented and how steps are defined for solving
problems.
• OOP focuses on representing problems using real-world objects
and their behaviour, while Structured Programming deals with
organizing the program in a logical structure.
Introduction
• A structured program is made up of simple program flow
structures, which are hierarchically organized.
• They are Sequence, Selection And Repetition.
What is Structured/ Procedural Programming?
• thinking about the problem to be solved in terms of real-
world elements and representing the problem in terms of
objects and their behaviour
• Classes depict the abstract representations of real world
objects
What is Object Oriented Programming?
• Classes have properties called attributes.
• Attributes are implemented as global and instance variables.
• Methods in the classes represent or define the behaviour of these
classes.
• Methods and attributes of classes are called the members of the class.
• An instance of a class is called an object.
What is Object Oriented Programming?
There are several important OOP concepts such as
• Data abstraction,
• Encapsulation,
• Polymorphism,
• Messaging,
• Modularity and
• Inheritance.
What is Object Oriented Programming?
What is Object Oriented Programming?
Structured/Procedural Programming Object Oriented Programming
Structured Programming is designed which focuses on
process/ logical structure and then data required for
that process.
Object Oriented Programming is designed which focuses
on data.
Structured programming follows top-down approach.
Object oriented programming follows bottom-up
approach.
Structured Programming is also known as Modular
Programming and a subset of procedural programming
language.
Object Oriented Programming supports inheritance,
encapsulation, abstraction, polymorphism, etc.
In Structured Programming, Programs are divided into
small self-contained functions.
In Object Oriented Programming, Programs are divided
into small entities called objects.
Structured Programming is less secure as there is no
way of data hiding.
Object Oriented Programming is more secure as having
data hiding feature.
Structured Programming can solve moderately complex
programs.
Object Oriented Programming can solve any complex
programs.
Structured Programming provides less reusability, more
function dependency.
Object Oriented Programming provides more
reusability, less function dependency.
Less abstraction and less flexibility. More abstraction and more flexibility.
• OOP allow decomposition of a problem into a number of entities
called Object and then builds data and function around these
objects.
The data of the objects can be accessed only by the functions associated with
that object.
The functions of one object can access the functions of other object.
OOPs Basic concepts
• Class is a blueprint of an object that contains variables for storing data and
functions to performing operations on these data.
• Class will not occupy any memory space and hence it is only
logical representation of data.
class Employee
{
}
OOPs Basic concepts…Class:
• Objects are the basic run-time entities in an object oriented system. They may
represent a person, a place or any item that the program has to handle.
• "Object is a Software bundle of related variable and methods."
• “Object is an instance of a class”
OOPs Basic concepts…Object:
OOPs Basic concepts…Object:
• Class will not occupy any memory space. Hence to work with the data
represented by the class you must create a variable for the class, which is called
as an object.
OOPs Basic concepts…Object:
• When an object is created by using the keyword new, then memory will be
allocated for the class in heap memory area, which is called as an instance and
its starting address will be stored in the object in stack memory area.
• When an object is created without the keyword new, then memory will not be
allocated in heap i.e. instance will not be created and object in the stack contains
the value null.
OOPs Basic concepts…Object:
• When an object contains null, then it is not possible to access the members of the
class using that object.
class Employee
{
}
• Syntax to create an object of class Employee:-
Employee objEmp = new Employee();
OOPs Basic concepts…Object:
• Abstraction
• Encapsulation
• Inheritance
• Polymorphism
OOPs Basic concepts…
• Abstraction is "To represent the essential feature without representing the back
ground details."
• Abstraction lets you focus on what the object does instead of how it does it.
• Abstraction provides you a generalized view of your classes or object by providing
relevant information.
• Abstraction is the process of hiding the working style of an object, and showing
the information of an object in understandable manner.
OOPs Basic concepts…Abstraction
• Real world Example of Abstraction: -
• Suppose you have an object Mobile Phone.
• Suppose you have 3 mobile phones as following:-
Nokia 1400 (Features:- Calling, SMS)
Nokia 2700 (Features:- Calling, SMS, FM Radio, MP3, Camera)
Black Berry (Features:-Calling, SMS, FM Radio, MP3, Camera, Video Recording, Reading E-mails)
OOPs Basic concepts…Abstraction
Abstract information (Necessary and Common Information) for the object "Mobile Phone" is make a call to any
number and can send SMS." So that, for mobile phone object you will have abstract class like following:-
OOPs Basic concepts…Abstraction
abstract class MobilePhone
{
public void Calling();
public void SendSMS();
}
public class Nokia1400 : MobilePhone
{
}
public class Nokia2700 : MobilePhone
{
public void FMRadio();
public void MP3();
public void Camera();
}
public class BlackBerry : MobilePhone
{
public void FMRadio();
public void MP3();
public void Camera();
public void Recording();
public void ReadAndSendEmails();
}
• Wrapping up data member and method together into a single unit (i.e. Class) is
called Encapsulation.
• That is enclosing the related operations and data related to an object into that
object.
OOPs Basic concepts…Encapsulation
class Teacher
{
int id;
string name;
void teaching();
}
class Demo
{
private int mark;
public int Mark
{
get { return mark; }
set { if (mark > 0)
mark = value; else _mark = 0;
}
}
}
OOPs Basic concepts…Encapsulation
• When a class acquire the property of another class is known as inheritance.
• Inheritance is process of object reusability.
OOPs Basic concepts…Inheritance
OOPs Basic concepts…Inheritance
public class ParentClass
{
public ParentClass()
{
Console.WriteLine("Parent Constructor.");
}
public void print()
{
Console.WriteLine("I'm a Parent Class.");
}
}
public class ChildClass : ParentClass
{
public ChildClass()
{
Console.WriteLine("Child Constructor.");
}
public static void Main()
{
ChildClass child = new ChildClass();
child.print();
}
}
• Polymorphism means one name many forms.
• One function behaves different forms. .
• In other words, "Many forms of a single object is called Polymorphism."
OOPs Basic concepts…Polymorphism
Difference between Abstraction and Encapsulation
Abstraction Encapsulation
1. Abstraction solves the problem in the design
level.
1. Encapsulation solves the problem in the
implementation level.
2. Abstraction is used for hiding the unwanted
data and giving relevant data.
2. Encapsulation means hiding the code and data
into a single unit to protect the data from outside
world.
3. Abstraction lets you focus on what the object
does instead of how it does it
3. Encapsulation means hiding the internal details
or mechanics of how an object does something.
4. Abstraction- Outer layout, used in terms of
design.
For Example:-
Outer Look of a Mobile Phone, like it has a display
screen and keypad buttons to dial a number.
4. Encapsulation- Inner layout, used in terms of
implementation.
For Example:- Inner Implementation detail of a
Mobile Phone, how keypad button and Display
Screen are connect with each other using circuits.

More Related Content

PPT
Object Oriented Programming Concepts
thinkphp
 
PPTX
[OOP - Lec 18] Static Data Member
Muhammad Hammad Waseem
 
PPTX
Deadlock ppt
Sweetestangel Kochar
 
PPTX
Python Exception Handling
Megha V
 
PPT
Introduction to oop
Kumar
 
PPTX
Two pass Assembler
Satyamevjayte Haxor
 
PPT
Joins in SQL
Vigneshwaran Sankaran
 
PPT
9. Input Output in java
Nilesh Dalvi
 
Object Oriented Programming Concepts
thinkphp
 
[OOP - Lec 18] Static Data Member
Muhammad Hammad Waseem
 
Deadlock ppt
Sweetestangel Kochar
 
Python Exception Handling
Megha V
 
Introduction to oop
Kumar
 
Two pass Assembler
Satyamevjayte Haxor
 
Joins in SQL
Vigneshwaran Sankaran
 
9. Input Output in java
Nilesh Dalvi
 

What's hot (20)

PDF
Python exception handling
Mohammed Sikander
 
PPTX
Introduction to-python
Aakashdata
 
PPTX
Abstract Data Types
karthikeyanC40
 
PPTX
Language design and translation issues
Dr. SURBHI SAROHA
 
PPT
6 multiprogramming & time sharing
myrajendra
 
PPTX
Data structures and algorithms
Julie Iskander
 
PPTX
Programming Fundamentals
Trivuz ত্রিভুজ
 
PPTX
Introduction to problem solving in C
Diwakar Pratap Singh 'Deva'
 
PPTX
introduction to programming languages
NaqashAhmad14
 
PPTX
Object-Oriented Paradigm
tamigayle
 
PPTX
Error Detection & Recovery
Akhil Kaushik
 
PPTX
Procedural programming
Ankit92Chitnavis
 
PPT
C by balaguruswami - e.balagurusamy
Srichandan Sobhanayak
 
PPT
Object-oriented concepts
BG Java EE Course
 
PPTX
Strings in Java
Abhilash Nair
 
PPTX
History of Programming Language
tahria123
 
PPTX
System Programing Unit 1
Manoj Patil
 
PPTX
Ch 4 linker loader
Malek Sumaiya
 
PDF
Introduction to python programming
Srinivas Narasegouda
 
Python exception handling
Mohammed Sikander
 
Introduction to-python
Aakashdata
 
Abstract Data Types
karthikeyanC40
 
Language design and translation issues
Dr. SURBHI SAROHA
 
6 multiprogramming & time sharing
myrajendra
 
Data structures and algorithms
Julie Iskander
 
Programming Fundamentals
Trivuz ত্রিভুজ
 
Introduction to problem solving in C
Diwakar Pratap Singh 'Deva'
 
introduction to programming languages
NaqashAhmad14
 
Object-Oriented Paradigm
tamigayle
 
Error Detection & Recovery
Akhil Kaushik
 
Procedural programming
Ankit92Chitnavis
 
C by balaguruswami - e.balagurusamy
Srichandan Sobhanayak
 
Object-oriented concepts
BG Java EE Course
 
Strings in Java
Abhilash Nair
 
History of Programming Language
tahria123
 
System Programing Unit 1
Manoj Patil
 
Ch 4 linker loader
Malek Sumaiya
 
Introduction to python programming
Srinivas Narasegouda
 
Ad

Similar to introduction of Object oriented programming (20)

PDF
L1-Introduction to OOPs concepts.pdf
BhanuJatinSingh
 
PPTX
Object Oriented Programming Concepts Using C++
Mtnc BCA DEPARTMENT
 
PPTX
Object oriented programming
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
Chapter 04 object oriented programming
Praveen M Jigajinni
 
PDF
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
ApurvaLaddha
 
PDF
1unit-120324103142-phpapp02.pdf
SahajShrimal1
 
PPTX
Unit 1 OOSE
ChhayaShelake
 
PPTX
An overview of Object Oriented Programming in C#.
prajapatrishabh421
 
PPTX
CPP-Unit 1.pptx
YashKoli22
 
PPTX
JAVA PROGRAMMINGD
Niyitegekabilly
 
PPTX
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
berihun18
 
PDF
Oops concepts || Object Oriented Programming Concepts in Java
Madishetty Prathibha
 
PPT
Share Unit 1- Basic concept of object-oriented-programming.ppt
hannahrroselin95
 
PPTX
Birasa 1
Niyitegekabilly
 
PPTX
JAVA PROGRAMMING
Niyitegekabilly
 
PPTX
the Concept of Object-Oriented Programming
Aida Ramlan II
 
PPTX
Object oriented programming concepts
rahuld115
 
PPTX
Object oriented programming concepts
rahuld115
 
PPTX
Unit - I Intro. to OOP Concepts and Control Structure -OOP and CG (2024 Patte...
babasahebgaikwad8
 
PDF
Object-Oriented Programming (OOP)
Ahmad karawash
 
L1-Introduction to OOPs concepts.pdf
BhanuJatinSingh
 
Object Oriented Programming Concepts Using C++
Mtnc BCA DEPARTMENT
 
Chapter 04 object oriented programming
Praveen M Jigajinni
 
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
ApurvaLaddha
 
1unit-120324103142-phpapp02.pdf
SahajShrimal1
 
Unit 1 OOSE
ChhayaShelake
 
An overview of Object Oriented Programming in C#.
prajapatrishabh421
 
CPP-Unit 1.pptx
YashKoli22
 
JAVA PROGRAMMINGD
Niyitegekabilly
 
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
berihun18
 
Oops concepts || Object Oriented Programming Concepts in Java
Madishetty Prathibha
 
Share Unit 1- Basic concept of object-oriented-programming.ppt
hannahrroselin95
 
Birasa 1
Niyitegekabilly
 
JAVA PROGRAMMING
Niyitegekabilly
 
the Concept of Object-Oriented Programming
Aida Ramlan II
 
Object oriented programming concepts
rahuld115
 
Object oriented programming concepts
rahuld115
 
Unit - I Intro. to OOP Concepts and Control Structure -OOP and CG (2024 Patte...
babasahebgaikwad8
 
Object-Oriented Programming (OOP)
Ahmad karawash
 
Ad

Recently uploaded (20)

PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PDF
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
PDF
5.EXPLORING-FORCES-Detailed-Notes.pdf/8TH CLASS SCIENCE CURIOSITY
Sandeep Swamy
 
PDF
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PPTX
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
PPTX
Congenital Hypothyroidism pptx
AneetaSharma15
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
PPTX
ACUTE NASOPHARYNGITIS. pptx
AneetaSharma15
 
PPTX
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 
PDF
Wings of Fire Book by Dr. A.P.J Abdul Kalam Full PDF
hetalvaishnav93
 
PPTX
NOI Hackathon - Summer Edition - GreenThumber.pptx
MartinaBurlando1
 
PPT
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
PDF
The Picture of Dorian Gray summary and depiction
opaliyahemel
 
PDF
Landforms and landscapes data surprise preview
jpinnuck
 
PDF
7.Particulate-Nature-of-Matter.ppt/8th class science curiosity/by k sandeep s...
Sandeep Swamy
 
PDF
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
5.EXPLORING-FORCES-Detailed-Notes.pdf/8TH CLASS SCIENCE CURIOSITY
Sandeep Swamy
 
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
Congenital Hypothyroidism pptx
AneetaSharma15
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
ACUTE NASOPHARYNGITIS. pptx
AneetaSharma15
 
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 
Wings of Fire Book by Dr. A.P.J Abdul Kalam Full PDF
hetalvaishnav93
 
NOI Hackathon - Summer Edition - GreenThumber.pptx
MartinaBurlando1
 
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
The Picture of Dorian Gray summary and depiction
opaliyahemel
 
Landforms and landscapes data surprise preview
jpinnuck
 
7.Particulate-Nature-of-Matter.ppt/8th class science curiosity/by k sandeep s...
Sandeep Swamy
 
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 

introduction of Object oriented programming

  • 1. CHAPTER 1 INTRODUCTION TO THE OOP PARADIGM
  • 2. Introduction • Object Oriented Programming (OOP) • Structured Programming • Programming paradigm is a fundamental style of computer programming
  • 3. • Object Oriented Programming (OOP) • Structured Programming • Programming paradigm is a fundamental style of computer programming Introduction
  • 4. • Programming paradigms differ in how each element of the programs is represented and how steps are defined for solving problems. • OOP focuses on representing problems using real-world objects and their behaviour, while Structured Programming deals with organizing the program in a logical structure. Introduction
  • 5. • A structured program is made up of simple program flow structures, which are hierarchically organized. • They are Sequence, Selection And Repetition. What is Structured/ Procedural Programming?
  • 6. • thinking about the problem to be solved in terms of real- world elements and representing the problem in terms of objects and their behaviour • Classes depict the abstract representations of real world objects What is Object Oriented Programming?
  • 7. • Classes have properties called attributes. • Attributes are implemented as global and instance variables. • Methods in the classes represent or define the behaviour of these classes. • Methods and attributes of classes are called the members of the class. • An instance of a class is called an object. What is Object Oriented Programming?
  • 8. There are several important OOP concepts such as • Data abstraction, • Encapsulation, • Polymorphism, • Messaging, • Modularity and • Inheritance. What is Object Oriented Programming?
  • 9. What is Object Oriented Programming? Structured/Procedural Programming Object Oriented Programming Structured Programming is designed which focuses on process/ logical structure and then data required for that process. Object Oriented Programming is designed which focuses on data. Structured programming follows top-down approach. Object oriented programming follows bottom-up approach. Structured Programming is also known as Modular Programming and a subset of procedural programming language. Object Oriented Programming supports inheritance, encapsulation, abstraction, polymorphism, etc. In Structured Programming, Programs are divided into small self-contained functions. In Object Oriented Programming, Programs are divided into small entities called objects. Structured Programming is less secure as there is no way of data hiding. Object Oriented Programming is more secure as having data hiding feature. Structured Programming can solve moderately complex programs. Object Oriented Programming can solve any complex programs. Structured Programming provides less reusability, more function dependency. Object Oriented Programming provides more reusability, less function dependency. Less abstraction and less flexibility. More abstraction and more flexibility.
  • 10. • OOP allow decomposition of a problem into a number of entities called Object and then builds data and function around these objects. The data of the objects can be accessed only by the functions associated with that object. The functions of one object can access the functions of other object. OOPs Basic concepts
  • 11. • Class is a blueprint of an object that contains variables for storing data and functions to performing operations on these data. • Class will not occupy any memory space and hence it is only logical representation of data. class Employee { } OOPs Basic concepts…Class:
  • 12. • Objects are the basic run-time entities in an object oriented system. They may represent a person, a place or any item that the program has to handle. • "Object is a Software bundle of related variable and methods." • “Object is an instance of a class” OOPs Basic concepts…Object:
  • 14. • Class will not occupy any memory space. Hence to work with the data represented by the class you must create a variable for the class, which is called as an object. OOPs Basic concepts…Object:
  • 15. • When an object is created by using the keyword new, then memory will be allocated for the class in heap memory area, which is called as an instance and its starting address will be stored in the object in stack memory area. • When an object is created without the keyword new, then memory will not be allocated in heap i.e. instance will not be created and object in the stack contains the value null. OOPs Basic concepts…Object:
  • 16. • When an object contains null, then it is not possible to access the members of the class using that object. class Employee { } • Syntax to create an object of class Employee:- Employee objEmp = new Employee(); OOPs Basic concepts…Object:
  • 17. • Abstraction • Encapsulation • Inheritance • Polymorphism OOPs Basic concepts…
  • 18. • Abstraction is "To represent the essential feature without representing the back ground details." • Abstraction lets you focus on what the object does instead of how it does it. • Abstraction provides you a generalized view of your classes or object by providing relevant information. • Abstraction is the process of hiding the working style of an object, and showing the information of an object in understandable manner. OOPs Basic concepts…Abstraction
  • 19. • Real world Example of Abstraction: - • Suppose you have an object Mobile Phone. • Suppose you have 3 mobile phones as following:- Nokia 1400 (Features:- Calling, SMS) Nokia 2700 (Features:- Calling, SMS, FM Radio, MP3, Camera) Black Berry (Features:-Calling, SMS, FM Radio, MP3, Camera, Video Recording, Reading E-mails) OOPs Basic concepts…Abstraction
  • 20. Abstract information (Necessary and Common Information) for the object "Mobile Phone" is make a call to any number and can send SMS." So that, for mobile phone object you will have abstract class like following:- OOPs Basic concepts…Abstraction abstract class MobilePhone { public void Calling(); public void SendSMS(); } public class Nokia1400 : MobilePhone { } public class Nokia2700 : MobilePhone { public void FMRadio(); public void MP3(); public void Camera(); } public class BlackBerry : MobilePhone { public void FMRadio(); public void MP3(); public void Camera(); public void Recording(); public void ReadAndSendEmails(); }
  • 21. • Wrapping up data member and method together into a single unit (i.e. Class) is called Encapsulation. • That is enclosing the related operations and data related to an object into that object. OOPs Basic concepts…Encapsulation class Teacher { int id; string name; void teaching(); }
  • 22. class Demo { private int mark; public int Mark { get { return mark; } set { if (mark > 0) mark = value; else _mark = 0; } } } OOPs Basic concepts…Encapsulation
  • 23. • When a class acquire the property of another class is known as inheritance. • Inheritance is process of object reusability. OOPs Basic concepts…Inheritance
  • 24. OOPs Basic concepts…Inheritance public class ParentClass { public ParentClass() { Console.WriteLine("Parent Constructor."); } public void print() { Console.WriteLine("I'm a Parent Class."); } } public class ChildClass : ParentClass { public ChildClass() { Console.WriteLine("Child Constructor."); } public static void Main() { ChildClass child = new ChildClass(); child.print(); } }
  • 25. • Polymorphism means one name many forms. • One function behaves different forms. . • In other words, "Many forms of a single object is called Polymorphism." OOPs Basic concepts…Polymorphism
  • 26. Difference between Abstraction and Encapsulation Abstraction Encapsulation 1. Abstraction solves the problem in the design level. 1. Encapsulation solves the problem in the implementation level. 2. Abstraction is used for hiding the unwanted data and giving relevant data. 2. Encapsulation means hiding the code and data into a single unit to protect the data from outside world. 3. Abstraction lets you focus on what the object does instead of how it does it 3. Encapsulation means hiding the internal details or mechanics of how an object does something. 4. Abstraction- Outer layout, used in terms of design. For Example:- Outer Look of a Mobile Phone, like it has a display screen and keypad buttons to dial a number. 4. Encapsulation- Inner layout, used in terms of implementation. For Example:- Inner Implementation detail of a Mobile Phone, how keypad button and Display Screen are connect with each other using circuits.