SlideShare a Scribd company logo
1 of 17
CST 205 Object Oriented Programming using Java
CST 281 Object Oriented Programming
(As per KTU 2019 Syllabus)
Module 1, Lecture 2
Module 1 Lecture 2
â–ş Approaches to Software Design. Functional Oriented Design, Object
Oriented Design, Case Study of Automated Fire Alarm System
â–ş Object Modeling Using Unified Modeling Language. Basic Object
Oriented concepts, UML diagrams, Use case model, Class diagram, Interaction
diagram, Activity diagram, State chart diagram
â–ş Introduction to Java Java programming. Environment and Runtime
Environment, Development Platforms - Standard, Enterprise. Java Virtual
Machine, Java compiler, Bytecode, Java applet Java Buzzwords, Java program
structure, Comments, Garbage Collection, Lexical Issues
Basic Object Oriented Concepts
In OOD, implementation of a software is based on the concepts of objects.
This approach is very close to the real-world applications
Class & Object
CLASS
â—Ź A class is a blueprint or prototype from
which objects are created
â—Ź A class is a generalized description of an
object. No physical existence.
â—Ź Acts as a type or category.
OBJECT
â—Ź An object is an instance of a class
â—Ź Objects are real-world entities that has
their own state and behavior.
â—Ź An object has physical existence
Class & Object
● Let’s take Student as a class. James is an instance / object of the class Student
â—Ź Object has a physical existence while a class is just a logical definition.
State => Variables
Name
RollNo
Behaviors => Functions
setName()
setRollNo()
Abstraction
â—Ź Abstraction means displaying only essential information and hiding the internal
details.
â—Ź It is a process of generalizing things at design level.
â—Ź Data abstraction refers to providing only essential information about the data
to the outside world, hiding the background details or implementation.
â—Ź Consider a real-life example of a man driving a car. The man only knows that
pressing the accelerators will increase the speed of the car or applying brakes
will stop the car.
â—Ź All about showing necessary details.
Encapsulation
â—Ź The wrapping up of data(variables) and functions (methods) that operates on the data,
into a single unit (called class) is known as encapsulation.
● It is also called "information hiding“, hides the internal representation, or state, of an
object from the outside through access modifies (Private / Public).
â—Ź Hiding unnecessary details, at implementation level.
Encapsulation...
• Protection of data from accidental corruption, by means of
access specifiers (Private / Public), it provides security.
• Flexibility and extensibility of the code and reduction in
complexity
• Encapsulation of a class can hide the internal details of how an
object does something
• Encapsulation protects abstraction
Abstraction & Encapsulation
Inheritance
The capability of a class to derive properties and
characteristics from another class is called Inheritance.
Inheritance is the process by which objects of one
class acquired the properties of objects of another
classes
Base Class : The class whose properties are inherited
by subclass is called Base Class or Super class.
Derived Class : The class that inherits properties from
another class is called Subclass or Derived Class.
Inheritance
Reusability: Inheritance supports the concept of “reusability”, i.e. when we want to
create a new class and there is already a class that includes some of the code that
we want, we can derive our new class from the existing class. By doing this, we are
reusing the fields and methods of the existing class.
Types of Inheritance
Polymorphism
â—Ź The word polymorphism means having many forms.
â—Ź Refers to a programming language's ability to process objects differently
depending on their data type or class
â—Ź An operation may exhibit different behaviors in different instances. The behavior
depends upon the types of data used in the operation.
â—Ź Ability for objects of different classes related by inheritance to respond differently to
the same member function call
Polymorphism...
â—Ź Static polymorphism: the binding between the method call an the method body happens
at the time of compilation and, this binding is known as static binding or early binding
â—Ź Runtime polymorphism or Dynamic Method Dispatch is a process in which a call to an
overridden method is resolved at runtime.
â—Ź Dynamic binding happens when all information needed for a function call cannot be
determined at compile-time
â—Ź In the example, same rotation of steering wheel causes, different mechanical operations,
corresponding to the steering type present in each cars.
â—Ź Brings flexibility to the implementations
Association, Composition and Aggregation
Association is relation between two separate
classes which establishes through their
Objects. Association can be one-to-one,
one-to-many, many-to-one, many-to-many.
Aggregation is a special form of
Association where:
It represents Has-A relationship.
It is a unidirectional association
In Aggregation, both the entries can
survive individually.
â—Ź Composition: It represents part-of relationship.
â—Ź In composition, both the entities are dependent
on each other.
â—Ź When there is a composition between two
entities, the composed object cannot exist
without the other entity.
OO concepts review
END OF LECTURE 2
References
â—Ź Rajib Mall, Fundamentals of Software Engineering, 4th edition, PHI, 2014.
â—Ź GeeksforGeeks - www.geeksforgeeks.org
â—Ź Wikipedia - www.wikipedia.org
â—Ź Tutorialspoint - www.tutorialspoint.com
â—Ź Disclaimer - This document contains images/texts from various internet
sources. Copyright belongs to the respective content creators. Document is
compiled exclusively for study purpose and shall not be used for commercial
purpose.

More Related Content

What's hot

Java Beans
Java BeansJava Beans
Java BeansAnkit Desai
 
Javascript Basic
Javascript BasicJavascript Basic
Javascript BasicKang-min Liu
 
Php File Operations
Php File OperationsPhp File Operations
Php File Operationsmussawir20
 
Coroutines in Kotlin
Coroutines in KotlinCoroutines in Kotlin
Coroutines in KotlinAlexey Soshin
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programmingAmit Soni (CTFL)
 
Advanced javascript
Advanced javascriptAdvanced javascript
Advanced javascriptDoeun KOCH
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQueryZeeshan Khan
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)slire
 
Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Peter R. Egli
 
Packages in java
Packages in javaPackages in java
Packages in javaJancypriya M
 
object oriented programming(oops)
object oriented programming(oops)object oriented programming(oops)
object oriented programming(oops)HANISHTHARWANI21BCE1
 
Iterator - a powerful but underappreciated design pattern
Iterator - a powerful but underappreciated design patternIterator - a powerful but underappreciated design pattern
Iterator - a powerful but underappreciated design patternNitin Bhide
 
Java Serialization
Java SerializationJava Serialization
Java Serializationimypraz
 
object oriented Programming ppt
object oriented Programming pptobject oriented Programming ppt
object oriented Programming pptNitesh Dubey
 
Java 8 date & time api
Java 8 date & time apiJava 8 date & time api
Java 8 date & time apiRasheed Waraich
 

What's hot (20)

Java beans
Java beansJava beans
Java beans
 
Java Beans
Java BeansJava Beans
Java Beans
 
Abstract class in java
Abstract class in javaAbstract class in java
Abstract class in java
 
Javascript Basic
Javascript BasicJavascript Basic
Javascript Basic
 
Php File Operations
Php File OperationsPhp File Operations
Php File Operations
 
Coroutines in Kotlin
Coroutines in KotlinCoroutines in Kotlin
Coroutines in Kotlin
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Advanced javascript
Advanced javascriptAdvanced javascript
Advanced javascript
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)
 
Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Remote Method Invocation (RMI)
Remote Method Invocation (RMI)
 
Packages in java
Packages in javaPackages in java
Packages in java
 
object oriented programming(oops)
object oriented programming(oops)object oriented programming(oops)
object oriented programming(oops)
 
Iterator - a powerful but underappreciated design pattern
Iterator - a powerful but underappreciated design patternIterator - a powerful but underappreciated design pattern
Iterator - a powerful but underappreciated design pattern
 
Java Serialization
Java SerializationJava Serialization
Java Serialization
 
Applets
AppletsApplets
Applets
 
Java 8 Date-Time API
Java 8 Date-Time APIJava 8 Date-Time API
Java 8 Date-Time API
 
object oriented Programming ppt
object oriented Programming pptobject oriented Programming ppt
object oriented Programming ppt
 
Java 8 date & time api
Java 8 date & time apiJava 8 date & time api
Java 8 date & time api
 
Rest api with node js and express
Rest api with node js and expressRest api with node js and express
Rest api with node js and express
 

Similar to Lecture 2 cst 205-281 oop

Cs2305 programming paradigms lecturer notes
Cs2305   programming paradigms lecturer notesCs2305   programming paradigms lecturer notes
Cs2305 programming paradigms lecturer notesSaravanakumar viswanathan
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP conceptsAhmed Farag
 
Md02 - Getting Started part-2
Md02 - Getting Started part-2Md02 - Getting Started part-2
Md02 - Getting Started part-2Rakesh Madugula
 
Ooad notes
Ooad notesOoad notes
Ooad notesNancyJP
 
Data Structure Interview Questions & Answers
Data Structure Interview Questions & AnswersData Structure Interview Questions & Answers
Data Structure Interview Questions & AnswersSatyam Jaiswal
 
OOPS in Java
OOPS in JavaOOPS in Java
OOPS in JavaZeeshan Khan
 
Object oriented basics
Object oriented basicsObject oriented basics
Object oriented basicsvamshimahi
 
Introduction to Object Oriented Concepts
Introduction to Object Oriented Concepts Introduction to Object Oriented Concepts
Introduction to Object Oriented Concepts Mamoun Nawahdah
 
software engineer interview questions.pdf
software engineer interview questions.pdfsoftware engineer interview questions.pdf
software engineer interview questions.pdfRaajpootQueen
 
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...Sakthi Durai
 
Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Sakthi Durai
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Conceptsthinkphp
 
Programming Laboratory Unit 1.pdf
Programming Laboratory Unit 1.pdfProgramming Laboratory Unit 1.pdf
Programming Laboratory Unit 1.pdfswapnilslide2019
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfL1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfBhanuJatinSingh
 

Similar to Lecture 2 cst 205-281 oop (20)

Cs2305 programming paradigms lecturer notes
Cs2305   programming paradigms lecturer notesCs2305   programming paradigms lecturer notes
Cs2305 programming paradigms lecturer notes
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
 
Md02 - Getting Started part-2
Md02 - Getting Started part-2Md02 - Getting Started part-2
Md02 - Getting Started part-2
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Ooad notes
Ooad notesOoad notes
Ooad notes
 
Data Structure Interview Questions & Answers
Data Structure Interview Questions & AnswersData Structure Interview Questions & Answers
Data Structure Interview Questions & Answers
 
Java unit 7
Java unit 7Java unit 7
Java unit 7
 
oopm 2.pdf
oopm 2.pdfoopm 2.pdf
oopm 2.pdf
 
OOPS in Java
OOPS in JavaOOPS in Java
OOPS in Java
 
Object oriented basics
Object oriented basicsObject oriented basics
Object oriented basics
 
Introduction to Object Oriented Concepts
Introduction to Object Oriented Concepts Introduction to Object Oriented Concepts
Introduction to Object Oriented Concepts
 
software engineer interview questions.pdf
software engineer interview questions.pdfsoftware engineer interview questions.pdf
software engineer interview questions.pdf
 
Mca 504 dotnet_unit3
Mca 504 dotnet_unit3Mca 504 dotnet_unit3
Mca 504 dotnet_unit3
 
MCA NOTES.pdf
MCA NOTES.pdfMCA NOTES.pdf
MCA NOTES.pdf
 
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
 
Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
Programming Laboratory Unit 1.pdf
Programming Laboratory Unit 1.pdfProgramming Laboratory Unit 1.pdf
Programming Laboratory Unit 1.pdf
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfL1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdf
 
Java chapter 3
Java   chapter 3Java   chapter 3
Java chapter 3
 

More from ktuonlinenotes

Oop suplemnertary september 2019
Oop suplemnertary september  2019Oop suplemnertary september  2019
Oop suplemnertary september 2019ktuonlinenotes
 
Oop r&s may 2019
Oop r&s may 2019Oop r&s may 2019
Oop r&s may 2019ktuonlinenotes
 
Oop r&s may 2019 (2)
Oop r&s may 2019 (2)Oop r&s may 2019 (2)
Oop r&s may 2019 (2)ktuonlinenotes
 
Oop december 2018
Oop december 2018Oop december 2018
Oop december 2018ktuonlinenotes
 
Module 1 uml - usecase digram
Module 1   uml - usecase digramModule 1   uml - usecase digram
Module 1 uml - usecase digramktuonlinenotes
 
Module 1 uml - interaction diagram
Module 1   uml - interaction diagramModule 1   uml - interaction diagram
Module 1 uml - interaction diagramktuonlinenotes
 
Lecture 4-oop class diagram
Lecture 4-oop class diagramLecture 4-oop class diagram
Lecture 4-oop class diagramktuonlinenotes
 
Lecture1 cst205 cst281-oop
Lecture1 cst205 cst281-oopLecture1 cst205 cst281-oop
Lecture1 cst205 cst281-oopktuonlinenotes
 
Lecture 3 cst205 cst281-oop
Lecture 3 cst205 cst281-oopLecture 3 cst205 cst281-oop
Lecture 3 cst205 cst281-oopktuonlinenotes
 

More from ktuonlinenotes (12)

Oop suplemnertary september 2019
Oop suplemnertary september  2019Oop suplemnertary september  2019
Oop suplemnertary september 2019
 
Oop sample ktu
Oop sample ktuOop sample ktu
Oop sample ktu
 
Oop r&s may 2019
Oop r&s may 2019Oop r&s may 2019
Oop r&s may 2019
 
Oop r&s may 2019 (2)
Oop r&s may 2019 (2)Oop r&s may 2019 (2)
Oop r&s may 2019 (2)
 
Oop july 2017
Oop july 2017Oop july 2017
Oop july 2017
 
Oop december 2018
Oop december 2018Oop december 2018
Oop december 2018
 
Oop april 2018
Oop april 2018Oop april 2018
Oop april 2018
 
Module 1 uml - usecase digram
Module 1   uml - usecase digramModule 1   uml - usecase digram
Module 1 uml - usecase digram
 
Module 1 uml - interaction diagram
Module 1   uml - interaction diagramModule 1   uml - interaction diagram
Module 1 uml - interaction diagram
 
Lecture 4-oop class diagram
Lecture 4-oop class diagramLecture 4-oop class diagram
Lecture 4-oop class diagram
 
Lecture1 cst205 cst281-oop
Lecture1 cst205 cst281-oopLecture1 cst205 cst281-oop
Lecture1 cst205 cst281-oop
 
Lecture 3 cst205 cst281-oop
Lecture 3 cst205 cst281-oopLecture 3 cst205 cst281-oop
Lecture 3 cst205 cst281-oop
 

Recently uploaded

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxsqpmdrvczh
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 

Lecture 2 cst 205-281 oop

  • 1. CST 205 Object Oriented Programming using Java CST 281 Object Oriented Programming (As per KTU 2019 Syllabus) Module 1, Lecture 2
  • 2. Module 1 Lecture 2 â–ş Approaches to Software Design. Functional Oriented Design, Object Oriented Design, Case Study of Automated Fire Alarm System â–ş Object Modeling Using Unified Modeling Language. Basic Object Oriented concepts, UML diagrams, Use case model, Class diagram, Interaction diagram, Activity diagram, State chart diagram â–ş Introduction to Java Java programming. Environment and Runtime Environment, Development Platforms - Standard, Enterprise. Java Virtual Machine, Java compiler, Bytecode, Java applet Java Buzzwords, Java program structure, Comments, Garbage Collection, Lexical Issues
  • 3. Basic Object Oriented Concepts In OOD, implementation of a software is based on the concepts of objects. This approach is very close to the real-world applications
  • 4. Class & Object CLASS â—Ź A class is a blueprint or prototype from which objects are created â—Ź A class is a generalized description of an object. No physical existence. â—Ź Acts as a type or category. OBJECT â—Ź An object is an instance of a class â—Ź Objects are real-world entities that has their own state and behavior. â—Ź An object has physical existence
  • 5. Class & Object â—Ź Let’s take Student as a class. James is an instance / object of the class Student â—Ź Object has a physical existence while a class is just a logical definition. State => Variables Name RollNo Behaviors => Functions setName() setRollNo()
  • 6. Abstraction â—Ź Abstraction means displaying only essential information and hiding the internal details. â—Ź It is a process of generalizing things at design level. â—Ź Data abstraction refers to providing only essential information about the data to the outside world, hiding the background details or implementation. â—Ź Consider a real-life example of a man driving a car. The man only knows that pressing the accelerators will increase the speed of the car or applying brakes will stop the car. â—Ź All about showing necessary details.
  • 7. Encapsulation â—Ź The wrapping up of data(variables) and functions (methods) that operates on the data, into a single unit (called class) is known as encapsulation. â—Ź It is also called "information hiding“, hides the internal representation, or state, of an object from the outside through access modifies (Private / Public). â—Ź Hiding unnecessary details, at implementation level.
  • 8. Encapsulation... • Protection of data from accidental corruption, by means of access specifiers (Private / Public), it provides security. • Flexibility and extensibility of the code and reduction in complexity • Encapsulation of a class can hide the internal details of how an object does something • Encapsulation protects abstraction
  • 10. Inheritance The capability of a class to derive properties and characteristics from another class is called Inheritance. Inheritance is the process by which objects of one class acquired the properties of objects of another classes Base Class : The class whose properties are inherited by subclass is called Base Class or Super class. Derived Class : The class that inherits properties from another class is called Subclass or Derived Class.
  • 11. Inheritance Reusability: Inheritance supports the concept of “reusability”, i.e. when we want to create a new class and there is already a class that includes some of the code that we want, we can derive our new class from the existing class. By doing this, we are reusing the fields and methods of the existing class.
  • 13. Polymorphism â—Ź The word polymorphism means having many forms. â—Ź Refers to a programming language's ability to process objects differently depending on their data type or class â—Ź An operation may exhibit different behaviors in different instances. The behavior depends upon the types of data used in the operation. â—Ź Ability for objects of different classes related by inheritance to respond differently to the same member function call
  • 14. Polymorphism... â—Ź Static polymorphism: the binding between the method call an the method body happens at the time of compilation and, this binding is known as static binding or early binding â—Ź Runtime polymorphism or Dynamic Method Dispatch is a process in which a call to an overridden method is resolved at runtime. â—Ź Dynamic binding happens when all information needed for a function call cannot be determined at compile-time â—Ź In the example, same rotation of steering wheel causes, different mechanical operations, corresponding to the steering type present in each cars. â—Ź Brings flexibility to the implementations
  • 15. Association, Composition and Aggregation Association is relation between two separate classes which establishes through their Objects. Association can be one-to-one, one-to-many, many-to-one, many-to-many. Aggregation is a special form of Association where: It represents Has-A relationship. It is a unidirectional association In Aggregation, both the entries can survive individually. â—Ź Composition: It represents part-of relationship. â—Ź In composition, both the entities are dependent on each other. â—Ź When there is a composition between two entities, the composed object cannot exist without the other entity.
  • 16. OO concepts review END OF LECTURE 2
  • 17. References â—Ź Rajib Mall, Fundamentals of Software Engineering, 4th edition, PHI, 2014. â—Ź GeeksforGeeks - www.geeksforgeeks.org â—Ź Wikipedia - www.wikipedia.org â—Ź Tutorialspoint - www.tutorialspoint.com â—Ź Disclaimer - This document contains images/texts from various internet sources. Copyright belongs to the respective content creators. Document is compiled exclusively for study purpose and shall not be used for commercial purpose.