SlideShare a Scribd company logo
1 of 27
CMP-2123-Object
Oriented Programming
Lecture 1.1
By
Abrar Ahmad
Abrar.ahmad14@ce.ceme.edu.pk
Course Introduction
•Prerequisites
•Programming Fundamentals
•Course Objective
•This course aims to develop students’ Objects
oriented programming skills.
2arbabwaseer@gmail.com
Course Introduction
•Textbook
•Java Programming From the Ground Up by Ralph
Bravaco and Shai Simonson, McGraw-Hill Higher
Education New York, 2010, ISBN: 978-0-07-352335-4
•Ivor Horton’s Beginning Java by Ivor Horton, John
Wiley & Sons, Inc. 7th Edition, 2011, ISBN: 978-0-470-
40414-0
3arbabwaseer@gmail.com
Course Introduction
•Reference Material
•Java TM Programming by Joycee Farrell,6th Edition,
Cengage Learning, 2012, ISBN-13: 978-1-111-
52944-4
•Java TM How to Program By Paul Deitel and Harvery
Deitel, Pearson,9th Edition, 2012, ISBN-13: 978-0-
13-257566-9
4arbabwaseer@gmail.com
Course Overview
• Objects and Classes, Abstraction Encapsulation
• Final Classes, Nested and Inner Classes
• Inheritance, Abstract Classes, Concrete Classes,
Inheritance and Encapsulation
• The is-a Relationship, Inheritance via Abstract Classes,
Extending the Hierarchy, Upcasting and Downcasting,
Interfaces
5arbabwaseer@gmail.com
Course Overview
• Composition, has-a Relationship
• Polymorphism
• Dynamic Binding
• Interfaces and Polymorphism
6arbabwaseer@gmail.com
Course Overview
•The Wrapper Classes, Boxing and Unboxing Packages
•Exceptions and Exception Handling
•File System and paths, File Directory Handling and
Manipulation, Input/Output Streams, Reading Binary Data,
Writing Binary Data, Writing Text, reading text, Logging
with PrintStream, Random Access Files, Serialization
•Collection for-each Loop
7arbabwaseer@gmail.com
Course Overview
• GUI Concepts, Components and Containers, Abstract
Windows Toolkit and Swing, Windows and Frames, Layout
Managers, Panels
• Event-Driven Programming, The Delegation Event Model
• Event Classes, Mouse Events, Keyboard Events, Using Actions
• Component and Jcomponent, Buttons, Labels, Text Fields,
Text Areas, Dialog Boxes, Checkboxes, and Radio Buttons,
Menus, Jslider, JTabbedPane
8arbabwaseer@gmail.com
What is OOP
• Object-oriented programming (OOP) is a programming
language model organized around objects rather than
"actions" and data rather than logic.
• Historically, a program has been viewed as a logical
procedure that
• takes input data
• processes it
• produces output data.
• The programming challenge was seen as how to write the
logic, not how to define the data.
9arbabwaseer@gmail.com
What is OOP
• Object-oriented programming takes the view that what we really
care about are the objects we want to manipulate rather than
the logic required to manipulate them.
• Example
• Human Being
• Name
• Height
• Age
• Gender
• Race
• etc
10arbabwaseer@gmail.com
What is OOP
•Object Oriented Programming is an engineering
approach for building software systems
•Based on the concepts of
•Classes
•Objects
That are used for modeling the real world entities.
11arbabwaseer@gmail.com
Why OOP
•Better suited for team development
•Facilitate utilizing and creating reusable components.
•Easier GUI Programming
•Easier Software maintenance
12arbabwaseer@gmail.com
Principles of OOP
•Inheritance
•Abstraction
•Encapsulation
•Polymorphism
13arbabwaseer@gmail.com
About
• Simula is considered as the first object-oriented
programming language. The programming paradigm
where everything is represented as an object, is
known as truly object-oriented programming
language.
14arbabwaseer@gmail.com
OOP
• Object means a real word entity such as pen, chair, table etc. Object-
Oriented Programming is a methodology or paradigm to design a
program using classes and objects. It simplifies the software
development and maintenance by providing some concepts:
• Object
• Class
• Inheritance
• Polymorphism
• Abstraction
• Encapsulation
15arbabwaseer@gmail.com
Object:
Any entity that has state and behavior is known as an
object. For example: chair, pen, table, keyboard, bike
etc. It can be physical and logical. 16arbabwaseer@gmail.com
• Syntax to declare a class:
•Class
• Collection of objects is called class. It is a logical entity.
17arbabwaseer@gmail.com
Simple Example of Object and Class
• In this example, we have created a Student class that have two data
members id and name. We are creating the object of the Student
class by new keyword and printing the objects value.
18arbabwaseer@gmail.com
19arbabwaseer@gmail.com
20arbabwaseer@gmail.com
•Polymorphism
• When one task is performed by different ways i.e. known as
polymorphism. For example: to convince the customer
differently, to draw something e.g. shape or rectangle etc.
• In java, we use method overloading and method overriding to
achieve polymorphism.
• Another example can be to speak something e.g. cat speaks
meaw, dog barks woof etc.
•Inheritance
• When one object acquires all the properties and behaviors
of parent object i.e. known as inheritance. It provides code
reusability. It is used to achieve runtime polymorphism.
21arbabwaseer@gmail.com
22arbabwaseer@gmail.com
• Abstraction
• Hiding internal details and showing functionality is known as
abstraction. For example: phone call, we don't know the internal
processing.
• In java, we use abstract class and interface to achieve abstraction.
•Encapsulation
• Binding (or wrapping) code and data together into a single
unit is known as encapsulation. For example: capsule, it is
wrapped with different medicines.
• A java class is the example of encapsulation. Java bean is the
fully encapsulated class because all the data members are
private here.
23arbabwaseer@gmail.com
24arbabwaseer@gmail.com
Advantage of OOPs over Procedure-
oriented programming language
• OOPs makes development and maintenance easier where as
in Procedure-oriented programming language it is not easy
to manage if code grows as project size grows.
• OOPs provides data hiding whereas in Procedure-oriented
programming language a global data can be accessed from
anywhere.
• OOPs provides ability to simulate real-world event much
more effectively. We can provide the solution of real word
problem if we are using the Object-Oriented Programming
language. 25arbabwaseer@gmail.com
26arbabwaseer@gmail.com
•What is difference between object-oriented
programming language and object-based
programming language?
• Object based programming language follows all the
features of OOPs except Inheritance. JavaScript and
VBScript are examples of object based
programming languages.
27arbabwaseer@gmail.com

More Related Content

Similar to OOP Course Lecture on Classes, Objects, Inheritance

U1 JAVA.pptx
U1 JAVA.pptxU1 JAVA.pptx
U1 JAVA.pptxmadan r
 
Object-Oriented concepts.pptx
Object-Oriented concepts.pptxObject-Oriented concepts.pptx
Object-Oriented concepts.pptxBHARATH KUMAR
 
Object oriented programming concept- Saurabh Upadhyay
Object oriented programming concept- Saurabh UpadhyayObject oriented programming concept- Saurabh Upadhyay
Object oriented programming concept- Saurabh UpadhyaySaurabh Upadhyay
 
Top 100 Java Interview Questions with Detailed Answers
Top 100 Java Interview Questions with Detailed AnswersTop 100 Java Interview Questions with Detailed Answers
Top 100 Java Interview Questions with Detailed AnswersWhizlabs
 
Introduction to oop and java fundamentals
Introduction to oop and java fundamentalsIntroduction to oop and java fundamentals
Introduction to oop and java fundamentalsAnsgarMary
 
C++ in object oriented programming
C++ in object oriented programmingC++ in object oriented programming
C++ in object oriented programmingSaket Khopkar
 
introduction of Object oriented programming
introduction of Object oriented programmingintroduction of Object oriented programming
introduction of Object oriented programmingRiturajJain8
 
Introduction To Design Patterns Class 4 Composition vs Inheritance
 Introduction To Design Patterns Class 4 Composition vs Inheritance Introduction To Design Patterns Class 4 Composition vs Inheritance
Introduction To Design Patterns Class 4 Composition vs InheritanceBlue Elephant Consulting
 
CPP-Unit 1.pptx
CPP-Unit 1.pptxCPP-Unit 1.pptx
CPP-Unit 1.pptxYashKoli22
 
MongoDB World 2019: A Tale of Two Use Cases: Innovative MongoDB Solutions for...
MongoDB World 2019: A Tale of Two Use Cases: Innovative MongoDB Solutions for...MongoDB World 2019: A Tale of Two Use Cases: Innovative MongoDB Solutions for...
MongoDB World 2019: A Tale of Two Use Cases: Innovative MongoDB Solutions for...MongoDB
 
Pi j1.0 workshop-introduction
Pi j1.0 workshop-introductionPi j1.0 workshop-introduction
Pi j1.0 workshop-introductionmcollison
 
Java Fundamentals Of Computer Science Using Java
Java   Fundamentals Of Computer Science Using JavaJava   Fundamentals Of Computer Science Using Java
Java Fundamentals Of Computer Science Using JavaPrabhu vip
 
SKILLWISE - OOPS CONCEPT
SKILLWISE - OOPS CONCEPTSKILLWISE - OOPS CONCEPT
SKILLWISE - OOPS CONCEPTSkillwise Group
 
Lesson 1 - Object Oriented Programming CPP103.pptx
Lesson 1 - Object Oriented Programming CPP103.pptxLesson 1 - Object Oriented Programming CPP103.pptx
Lesson 1 - Object Oriented Programming CPP103.pptxLuiFlor
 
1-Lec - Introduction vhvv,vbvv,v (2).ppt
1-Lec - Introduction vhvv,vbvv,v (2).ppt1-Lec - Introduction vhvv,vbvv,v (2).ppt
1-Lec - Introduction vhvv,vbvv,v (2).pptAqeelAbbas94
 
Upstate CSCI 200 Java Chapter 7 - OOP
Upstate CSCI 200 Java Chapter 7 - OOPUpstate CSCI 200 Java Chapter 7 - OOP
Upstate CSCI 200 Java Chapter 7 - OOPDanWooster1
 

Similar to OOP Course Lecture on Classes, Objects, Inheritance (20)

U1 JAVA.pptx
U1 JAVA.pptxU1 JAVA.pptx
U1 JAVA.pptx
 
Object-Oriented concepts.pptx
Object-Oriented concepts.pptxObject-Oriented concepts.pptx
Object-Oriented concepts.pptx
 
Object oriented programming concept- Saurabh Upadhyay
Object oriented programming concept- Saurabh UpadhyayObject oriented programming concept- Saurabh Upadhyay
Object oriented programming concept- Saurabh Upadhyay
 
Oops
OopsOops
Oops
 
C# by Zaheer Abbas Aghani
C# by Zaheer Abbas AghaniC# by Zaheer Abbas Aghani
C# by Zaheer Abbas Aghani
 
C# by Zaheer Abbas Aghani
C# by Zaheer Abbas AghaniC# by Zaheer Abbas Aghani
C# by Zaheer Abbas Aghani
 
Top 100 Java Interview Questions with Detailed Answers
Top 100 Java Interview Questions with Detailed AnswersTop 100 Java Interview Questions with Detailed Answers
Top 100 Java Interview Questions with Detailed Answers
 
Introduction to oop and java fundamentals
Introduction to oop and java fundamentalsIntroduction to oop and java fundamentals
Introduction to oop and java fundamentals
 
C++ in object oriented programming
C++ in object oriented programmingC++ in object oriented programming
C++ in object oriented programming
 
introduction of Object oriented programming
introduction of Object oriented programmingintroduction of Object oriented programming
introduction of Object oriented programming
 
Introduction To Design Patterns Class 4 Composition vs Inheritance
 Introduction To Design Patterns Class 4 Composition vs Inheritance Introduction To Design Patterns Class 4 Composition vs Inheritance
Introduction To Design Patterns Class 4 Composition vs Inheritance
 
oop.pptx
oop.pptxoop.pptx
oop.pptx
 
CPP-Unit 1.pptx
CPP-Unit 1.pptxCPP-Unit 1.pptx
CPP-Unit 1.pptx
 
MongoDB World 2019: A Tale of Two Use Cases: Innovative MongoDB Solutions for...
MongoDB World 2019: A Tale of Two Use Cases: Innovative MongoDB Solutions for...MongoDB World 2019: A Tale of Two Use Cases: Innovative MongoDB Solutions for...
MongoDB World 2019: A Tale of Two Use Cases: Innovative MongoDB Solutions for...
 
Pi j1.0 workshop-introduction
Pi j1.0 workshop-introductionPi j1.0 workshop-introduction
Pi j1.0 workshop-introduction
 
Java Fundamentals Of Computer Science Using Java
Java   Fundamentals Of Computer Science Using JavaJava   Fundamentals Of Computer Science Using Java
Java Fundamentals Of Computer Science Using Java
 
SKILLWISE - OOPS CONCEPT
SKILLWISE - OOPS CONCEPTSKILLWISE - OOPS CONCEPT
SKILLWISE - OOPS CONCEPT
 
Lesson 1 - Object Oriented Programming CPP103.pptx
Lesson 1 - Object Oriented Programming CPP103.pptxLesson 1 - Object Oriented Programming CPP103.pptx
Lesson 1 - Object Oriented Programming CPP103.pptx
 
1-Lec - Introduction vhvv,vbvv,v (2).ppt
1-Lec - Introduction vhvv,vbvv,v (2).ppt1-Lec - Introduction vhvv,vbvv,v (2).ppt
1-Lec - Introduction vhvv,vbvv,v (2).ppt
 
Upstate CSCI 200 Java Chapter 7 - OOP
Upstate CSCI 200 Java Chapter 7 - OOPUpstate CSCI 200 Java Chapter 7 - OOP
Upstate CSCI 200 Java Chapter 7 - OOP
 

More from Badar Waseer

Ch 03 s.e agile development
Ch 03 s.e agile developmentCh 03 s.e agile development
Ch 03 s.e agile developmentBadar Waseer
 
Ch 02 s.e software process models 1
Ch 02 s.e software process models   1Ch 02 s.e software process models   1
Ch 02 s.e software process models 1Badar Waseer
 
Ch 01 s.e introduction
Ch 01 s.e introductionCh 01 s.e introduction
Ch 01 s.e introductionBadar Waseer
 
Ch 14 s.e use case diagrams
Ch 14 s.e use case diagramsCh 14 s.e use case diagrams
Ch 14 s.e use case diagramsBadar Waseer
 
Lec 1.8 Object Oriented Programming
Lec 1.8 Object Oriented ProgrammingLec 1.8 Object Oriented Programming
Lec 1.8 Object Oriented ProgrammingBadar Waseer
 
Lec 1.7 Object Oriented Programming
Lec 1.7 Object Oriented ProgrammingLec 1.7 Object Oriented Programming
Lec 1.7 Object Oriented ProgrammingBadar Waseer
 
Lec 1.6 Object Oriented Programming
Lec 1.6 Object Oriented ProgrammingLec 1.6 Object Oriented Programming
Lec 1.6 Object Oriented ProgrammingBadar Waseer
 
Lec 1.5 Object Oriented Programming
Lec 1.5 Object Oriented ProgrammingLec 1.5 Object Oriented Programming
Lec 1.5 Object Oriented ProgrammingBadar Waseer
 
Lec 1.4 Object Oriented Programming
Lec 1.4 Object Oriented ProgrammingLec 1.4 Object Oriented Programming
Lec 1.4 Object Oriented ProgrammingBadar Waseer
 
Lec 1.3 Object Oriented Programming
Lec 1.3 Object Oriented ProgrammingLec 1.3 Object Oriented Programming
Lec 1.3 Object Oriented ProgrammingBadar Waseer
 
Lec 1.10 Object Oriented Programming
Lec 1.10 Object Oriented ProgrammingLec 1.10 Object Oriented Programming
Lec 1.10 Object Oriented ProgrammingBadar Waseer
 
Multimedia System & Design Ch 7 multimedia skills
Multimedia System & Design Ch 7 multimedia skillsMultimedia System & Design Ch 7 multimedia skills
Multimedia System & Design Ch 7 multimedia skillsBadar Waseer
 
Multimedia System & Design Ch 6 animation
Multimedia System & Design Ch 6 animationMultimedia System & Design Ch 6 animation
Multimedia System & Design Ch 6 animationBadar Waseer
 
Multimedia System & Design Ch 5 video
Multimedia System & Design Ch 5 videoMultimedia System & Design Ch 5 video
Multimedia System & Design Ch 5 videoBadar Waseer
 
Multimedia System & Design Ch 4 Audio
Multimedia System & Design Ch 4 AudioMultimedia System & Design Ch 4 Audio
Multimedia System & Design Ch 4 AudioBadar Waseer
 
Multimedia System & Design Ch 1, 2, 3 Multimedia
Multimedia System & Design Ch 1, 2, 3 MultimediaMultimedia System & Design Ch 1, 2, 3 Multimedia
Multimedia System & Design Ch 1, 2, 3 MultimediaBadar Waseer
 
Multimedia System & Design Ch 8 delivering
Multimedia System & Design Ch 8 deliveringMultimedia System & Design Ch 8 delivering
Multimedia System & Design Ch 8 deliveringBadar Waseer
 
Agriculture Information System (AIS)
Agriculture Information System (AIS)Agriculture Information System (AIS)
Agriculture Information System (AIS)Badar Waseer
 

More from Badar Waseer (20)

Ch 03 s.e agile development
Ch 03 s.e agile developmentCh 03 s.e agile development
Ch 03 s.e agile development
 
Ch 02 s.e software process models 1
Ch 02 s.e software process models   1Ch 02 s.e software process models   1
Ch 02 s.e software process models 1
 
Ch 01 s.e introduction
Ch 01 s.e introductionCh 01 s.e introduction
Ch 01 s.e introduction
 
Ch 14 s.e use case diagrams
Ch 14 s.e use case diagramsCh 14 s.e use case diagrams
Ch 14 s.e use case diagrams
 
Ch 13 s.e cmmi
Ch 13 s.e cmmiCh 13 s.e cmmi
Ch 13 s.e cmmi
 
Lec 1.9 oop
Lec 1.9 oopLec 1.9 oop
Lec 1.9 oop
 
Lec 1.8 Object Oriented Programming
Lec 1.8 Object Oriented ProgrammingLec 1.8 Object Oriented Programming
Lec 1.8 Object Oriented Programming
 
Lec 1.7 Object Oriented Programming
Lec 1.7 Object Oriented ProgrammingLec 1.7 Object Oriented Programming
Lec 1.7 Object Oriented Programming
 
Lec 1.6 Object Oriented Programming
Lec 1.6 Object Oriented ProgrammingLec 1.6 Object Oriented Programming
Lec 1.6 Object Oriented Programming
 
Lec 1.5 Object Oriented Programming
Lec 1.5 Object Oriented ProgrammingLec 1.5 Object Oriented Programming
Lec 1.5 Object Oriented Programming
 
Lec 1.4 Object Oriented Programming
Lec 1.4 Object Oriented ProgrammingLec 1.4 Object Oriented Programming
Lec 1.4 Object Oriented Programming
 
Lec 1.3 Object Oriented Programming
Lec 1.3 Object Oriented ProgrammingLec 1.3 Object Oriented Programming
Lec 1.3 Object Oriented Programming
 
Lec 1.10 Object Oriented Programming
Lec 1.10 Object Oriented ProgrammingLec 1.10 Object Oriented Programming
Lec 1.10 Object Oriented Programming
 
Multimedia System & Design Ch 7 multimedia skills
Multimedia System & Design Ch 7 multimedia skillsMultimedia System & Design Ch 7 multimedia skills
Multimedia System & Design Ch 7 multimedia skills
 
Multimedia System & Design Ch 6 animation
Multimedia System & Design Ch 6 animationMultimedia System & Design Ch 6 animation
Multimedia System & Design Ch 6 animation
 
Multimedia System & Design Ch 5 video
Multimedia System & Design Ch 5 videoMultimedia System & Design Ch 5 video
Multimedia System & Design Ch 5 video
 
Multimedia System & Design Ch 4 Audio
Multimedia System & Design Ch 4 AudioMultimedia System & Design Ch 4 Audio
Multimedia System & Design Ch 4 Audio
 
Multimedia System & Design Ch 1, 2, 3 Multimedia
Multimedia System & Design Ch 1, 2, 3 MultimediaMultimedia System & Design Ch 1, 2, 3 Multimedia
Multimedia System & Design Ch 1, 2, 3 Multimedia
 
Multimedia System & Design Ch 8 delivering
Multimedia System & Design Ch 8 deliveringMultimedia System & Design Ch 8 delivering
Multimedia System & Design Ch 8 delivering
 
Agriculture Information System (AIS)
Agriculture Information System (AIS)Agriculture Information System (AIS)
Agriculture Information System (AIS)
 

Recently uploaded

URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 

Recently uploaded (20)

URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 

OOP Course Lecture on Classes, Objects, Inheritance

  • 2. Course Introduction •Prerequisites •Programming Fundamentals •Course Objective •This course aims to develop students’ Objects oriented programming skills. 2arbabwaseer@gmail.com
  • 3. Course Introduction •Textbook •Java Programming From the Ground Up by Ralph Bravaco and Shai Simonson, McGraw-Hill Higher Education New York, 2010, ISBN: 978-0-07-352335-4 •Ivor Horton’s Beginning Java by Ivor Horton, John Wiley & Sons, Inc. 7th Edition, 2011, ISBN: 978-0-470- 40414-0 3arbabwaseer@gmail.com
  • 4. Course Introduction •Reference Material •Java TM Programming by Joycee Farrell,6th Edition, Cengage Learning, 2012, ISBN-13: 978-1-111- 52944-4 •Java TM How to Program By Paul Deitel and Harvery Deitel, Pearson,9th Edition, 2012, ISBN-13: 978-0- 13-257566-9 4arbabwaseer@gmail.com
  • 5. Course Overview • Objects and Classes, Abstraction Encapsulation • Final Classes, Nested and Inner Classes • Inheritance, Abstract Classes, Concrete Classes, Inheritance and Encapsulation • The is-a Relationship, Inheritance via Abstract Classes, Extending the Hierarchy, Upcasting and Downcasting, Interfaces 5arbabwaseer@gmail.com
  • 6. Course Overview • Composition, has-a Relationship • Polymorphism • Dynamic Binding • Interfaces and Polymorphism 6arbabwaseer@gmail.com
  • 7. Course Overview •The Wrapper Classes, Boxing and Unboxing Packages •Exceptions and Exception Handling •File System and paths, File Directory Handling and Manipulation, Input/Output Streams, Reading Binary Data, Writing Binary Data, Writing Text, reading text, Logging with PrintStream, Random Access Files, Serialization •Collection for-each Loop 7arbabwaseer@gmail.com
  • 8. Course Overview • GUI Concepts, Components and Containers, Abstract Windows Toolkit and Swing, Windows and Frames, Layout Managers, Panels • Event-Driven Programming, The Delegation Event Model • Event Classes, Mouse Events, Keyboard Events, Using Actions • Component and Jcomponent, Buttons, Labels, Text Fields, Text Areas, Dialog Boxes, Checkboxes, and Radio Buttons, Menus, Jslider, JTabbedPane 8arbabwaseer@gmail.com
  • 9. What is OOP • Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic. • Historically, a program has been viewed as a logical procedure that • takes input data • processes it • produces output data. • The programming challenge was seen as how to write the logic, not how to define the data. 9arbabwaseer@gmail.com
  • 10. What is OOP • Object-oriented programming takes the view that what we really care about are the objects we want to manipulate rather than the logic required to manipulate them. • Example • Human Being • Name • Height • Age • Gender • Race • etc 10arbabwaseer@gmail.com
  • 11. What is OOP •Object Oriented Programming is an engineering approach for building software systems •Based on the concepts of •Classes •Objects That are used for modeling the real world entities. 11arbabwaseer@gmail.com
  • 12. Why OOP •Better suited for team development •Facilitate utilizing and creating reusable components. •Easier GUI Programming •Easier Software maintenance 12arbabwaseer@gmail.com
  • 14. About • Simula is considered as the first object-oriented programming language. The programming paradigm where everything is represented as an object, is known as truly object-oriented programming language. 14arbabwaseer@gmail.com
  • 15. OOP • Object means a real word entity such as pen, chair, table etc. Object- Oriented Programming is a methodology or paradigm to design a program using classes and objects. It simplifies the software development and maintenance by providing some concepts: • Object • Class • Inheritance • Polymorphism • Abstraction • Encapsulation 15arbabwaseer@gmail.com
  • 16. Object: Any entity that has state and behavior is known as an object. For example: chair, pen, table, keyboard, bike etc. It can be physical and logical. 16arbabwaseer@gmail.com
  • 17. • Syntax to declare a class: •Class • Collection of objects is called class. It is a logical entity. 17arbabwaseer@gmail.com
  • 18. Simple Example of Object and Class • In this example, we have created a Student class that have two data members id and name. We are creating the object of the Student class by new keyword and printing the objects value. 18arbabwaseer@gmail.com
  • 21. •Polymorphism • When one task is performed by different ways i.e. known as polymorphism. For example: to convince the customer differently, to draw something e.g. shape or rectangle etc. • In java, we use method overloading and method overriding to achieve polymorphism. • Another example can be to speak something e.g. cat speaks meaw, dog barks woof etc. •Inheritance • When one object acquires all the properties and behaviors of parent object i.e. known as inheritance. It provides code reusability. It is used to achieve runtime polymorphism. 21arbabwaseer@gmail.com
  • 23. • Abstraction • Hiding internal details and showing functionality is known as abstraction. For example: phone call, we don't know the internal processing. • In java, we use abstract class and interface to achieve abstraction. •Encapsulation • Binding (or wrapping) code and data together into a single unit is known as encapsulation. For example: capsule, it is wrapped with different medicines. • A java class is the example of encapsulation. Java bean is the fully encapsulated class because all the data members are private here. 23arbabwaseer@gmail.com
  • 25. Advantage of OOPs over Procedure- oriented programming language • OOPs makes development and maintenance easier where as in Procedure-oriented programming language it is not easy to manage if code grows as project size grows. • OOPs provides data hiding whereas in Procedure-oriented programming language a global data can be accessed from anywhere. • OOPs provides ability to simulate real-world event much more effectively. We can provide the solution of real word problem if we are using the Object-Oriented Programming language. 25arbabwaseer@gmail.com
  • 27. •What is difference between object-oriented programming language and object-based programming language? • Object based programming language follows all the features of OOPs except Inheritance. JavaScript and VBScript are examples of object based programming languages. 27arbabwaseer@gmail.com