SlideShare une entreprise Scribd logo
1  sur  20
BLUEJ
PART 2
CHAPTER 1
INTRODUCTION TO OBJECT
ORIENTED PROGRAMMING.
WHAT IS CLASS?
CLASS IS A COMBINATION / COLLECTION OF DATA & METHOD THAT
WORKS ON DATA. IT IS DOESN’T TAKE ANY SPACE ON MEMORY.
A class is user defined blueprint or prototype from which object are
created.
CLASS DECELERATION CAN INCLUDE THESE COMPONENTS
1. Modifier: A class can be public or has default access.
2. Class Keyword: Class Keyword is used to create a class.
3. Class name: The name should begin with an initials letter.
4. Body: The class body surrounded by braces{ …..}.
CLASS
PRE DEFINED USER DEFINED
• STRING
• SCANNER
• CONSOLE
• SYTEM
• STRING
• DOG
• CAT
• A
• CAR
• HORSE
1. PRE DEFINED : A CLASS WHICH IS ALREADY CREATED & DEFINED BY
DEVELOPER IS CALLED PRE DEFINED CLASS.
2. USER DEFINED : A CLASS WHICH IS CREATED PROGRAMMER ( USER) IS
CALLED USER DEFINED.
Ex.
Class name
{ ………………………………..
………………………………….. // data
…………………………………
…………………………………… // methods
}
OBJECT
• It is basic unit of object oriented Programming & represent the real life entities.
• An object consists of three main essential features :
1. State: It is represented by attributes/properties of an object.it also reflect the
properties of an object.
2. Behaviour: It is represented by method of an object.it also reflects the response of
an object with other object.
3. Identity: It gives a unique name to an object and enables one object to interact
with other object
Identity: ceiling/ Table fan
State:
Colour
Animal
Identity : Name of the dog
Attribute:
Breed:
Color:
Behavoiur:
Eat();
Getcolor();
Plant
Identity: Name of the plant
Attribute:
Name
Type
Behavoiur:
getname();
Getcolor();
VECHICLE
Identity: Name of vechicle
Attribute:
Model
Chasis no
engine
Behavoiur:
Brake
acelerator
OBJECT IS AN INSTANCE OF CLASS THAT EXECUTES THE CLASS. ONCE THE OBJECT IS
CREATED, IT TAKE UP SPACE LIKE OTHER VARIABLES IN MEMORY.
OOPS
What is OOPS?
OOP STAND FOR OBJECT ORIENTED PROGRAMMING LANGUAGE, THE MAIN
PURPOSE OF OOP IS TO DEAL WITH REAL WORLD ENTITY USING PROGRAMMING
LANGUAGE.
PILLARS
PRINCIPLE
FEATURES & PRINCIPLE OF OOPS
• CLASS
• OBJECT
• ENCAPSULATION
• ABSTRACTION
• INHERITENCE
• POLYMORPHISM
ENCAPSULATION
DATA METHOD
ENCAPSULATION IS A MECHANISM THROUGH WHICH WE CAN WRAPPING
THE DATA & METHOD IN A SINGLE UNIT ( CLASS) .
class
DATA HIDING
THE VARIABLES OF A CLASS WILL BE HIDDEN FROM OTHER CLASSES, AND
CAN BE ACCESSED ONLY THROUGH THE METHODS OF THEIR CURRENT
CLASS IS KNOWN AS DATA HIDING.
DATA = PRIVATE
METHOD = PUBLIC
ABSTRACTION
Design may be complex
Keep interface simple
Abstraction is the process of hiding certain details and showing only
essential information to the user.
ALLOW ONLY VERY IMPORTANT
METHOD TO BE VISIBLE
DESIGNING OR STRUCTURE OF CAR ENGINE
BACKEND
USER INTERFACE
FRONTEND
INHERITANCE
USE THE EXISTING CLASS DESIGN AND ADD
SOMETHING NEW.
Inheritance in Java is a mechanism in which one object acquires all the properties
and behaviors of a parent object. It is an important part of OOPs (Object Oriented
programming system). YOU CAN REUSE METHODS AND FIELDS OF THE
PARENT CLASS.
CLASS ANIMAL{…..}
CLASS CAT CAN EXTEND ANIMAL {…..}
CLASS CROW CAN EXTENDS ANIMAL {……}
POLYMORPHISM
POLY MORPHISM
MANY – MORE
THAN ONE
FORMS
MANY FORMS
POLYMORPHISM IS THE
GREEK WORD WHOSE
MEANING IS “ SAME OBJECT
HAVING DIFFERENT
BEHAVIOUR”.
EXAMPLE
PERSON
FRIEND
TEACHER
STUDENT
CUSTOMER
1. VOID PERSON (TEACHER).
2. VOID PERSON
( STUDENT)
3. VOID PERSON ( CUSTOMER)
4. VOID PERSON ( FRIENDS)
END………….

Contenu connexe

Similaire à CHAPTER 1 BLUE JAVE ITRODUCTION TO OBJECT ORIENTED PROGRAMMING L2.pptx

Similaire à CHAPTER 1 BLUE JAVE ITRODUCTION TO OBJECT ORIENTED PROGRAMMING L2.pptx (20)

Php oop (1)
Php oop (1)Php oop (1)
Php oop (1)
 
Oops abap fundamental
Oops abap fundamentalOops abap fundamental
Oops abap fundamental
 
Lab 4 (1).pdf
Lab 4 (1).pdfLab 4 (1).pdf
Lab 4 (1).pdf
 
Opp concept in c++
Opp concept in c++Opp concept in c++
Opp concept in c++
 
Mca 504 dotnet_unit3
Mca 504 dotnet_unit3Mca 504 dotnet_unit3
Mca 504 dotnet_unit3
 
oop.pptx
oop.pptxoop.pptx
oop.pptx
 
JAVA-PPT'S.pdf
JAVA-PPT'S.pdfJAVA-PPT'S.pdf
JAVA-PPT'S.pdf
 
البرمجة الهدفية بلغة جافا - مفاهيم أساسية
البرمجة الهدفية بلغة جافا - مفاهيم أساسية البرمجة الهدفية بلغة جافا - مفاهيم أساسية
البرمجة الهدفية بلغة جافا - مفاهيم أساسية
 
Object Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft DeveloperObject Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft Developer
 
Oops
OopsOops
Oops
 
Object Oriented Javascript part2
Object Oriented Javascript part2Object Oriented Javascript part2
Object Oriented Javascript part2
 
Introduction to oop
Introduction to oopIntroduction to oop
Introduction to oop
 
Net Interview-Questions 1 - 16.pdf
Net Interview-Questions 1 - 16.pdfNet Interview-Questions 1 - 16.pdf
Net Interview-Questions 1 - 16.pdf
 
General oop concept
General oop conceptGeneral oop concept
General oop concept
 
Introduction to oop
Introduction to oop Introduction to oop
Introduction to oop
 
Lesson 13 object and class
Lesson 13 object and classLesson 13 object and class
Lesson 13 object and class
 
Programming paradigms
Programming paradigmsProgramming paradigms
Programming paradigms
 
object oriented programing lecture 1
object oriented programing lecture 1object oriented programing lecture 1
object oriented programing lecture 1
 
oopusingc.pptx
oopusingc.pptxoopusingc.pptx
oopusingc.pptx
 
Concepts of OOPs
Concepts of OOPsConcepts of OOPs
Concepts of OOPs
 

Dernier

Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
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
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
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
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
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
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 

Dernier (20)

Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
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 ...
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
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
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
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
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 

CHAPTER 1 BLUE JAVE ITRODUCTION TO OBJECT ORIENTED PROGRAMMING L2.pptx

  • 1. BLUEJ PART 2 CHAPTER 1 INTRODUCTION TO OBJECT ORIENTED PROGRAMMING.
  • 2. WHAT IS CLASS? CLASS IS A COMBINATION / COLLECTION OF DATA & METHOD THAT WORKS ON DATA. IT IS DOESN’T TAKE ANY SPACE ON MEMORY. A class is user defined blueprint or prototype from which object are created. CLASS DECELERATION CAN INCLUDE THESE COMPONENTS 1. Modifier: A class can be public or has default access. 2. Class Keyword: Class Keyword is used to create a class. 3. Class name: The name should begin with an initials letter. 4. Body: The class body surrounded by braces{ …..}.
  • 3. CLASS PRE DEFINED USER DEFINED • STRING • SCANNER • CONSOLE • SYTEM • STRING • DOG • CAT • A • CAR • HORSE
  • 4. 1. PRE DEFINED : A CLASS WHICH IS ALREADY CREATED & DEFINED BY DEVELOPER IS CALLED PRE DEFINED CLASS. 2. USER DEFINED : A CLASS WHICH IS CREATED PROGRAMMER ( USER) IS CALLED USER DEFINED. Ex. Class name { ……………………………….. ………………………………….. // data ………………………………… …………………………………… // methods }
  • 5. OBJECT • It is basic unit of object oriented Programming & represent the real life entities. • An object consists of three main essential features : 1. State: It is represented by attributes/properties of an object.it also reflect the properties of an object. 2. Behaviour: It is represented by method of an object.it also reflects the response of an object with other object. 3. Identity: It gives a unique name to an object and enables one object to interact with other object
  • 6. Identity: ceiling/ Table fan State: Colour
  • 7. Animal Identity : Name of the dog Attribute: Breed: Color: Behavoiur: Eat(); Getcolor(); Plant Identity: Name of the plant Attribute: Name Type Behavoiur: getname(); Getcolor(); VECHICLE Identity: Name of vechicle Attribute: Model Chasis no engine Behavoiur: Brake acelerator OBJECT IS AN INSTANCE OF CLASS THAT EXECUTES THE CLASS. ONCE THE OBJECT IS CREATED, IT TAKE UP SPACE LIKE OTHER VARIABLES IN MEMORY.
  • 8. OOPS What is OOPS? OOP STAND FOR OBJECT ORIENTED PROGRAMMING LANGUAGE, THE MAIN PURPOSE OF OOP IS TO DEAL WITH REAL WORLD ENTITY USING PROGRAMMING LANGUAGE.
  • 10. FEATURES & PRINCIPLE OF OOPS • CLASS • OBJECT • ENCAPSULATION • ABSTRACTION • INHERITENCE • POLYMORPHISM
  • 11. ENCAPSULATION DATA METHOD ENCAPSULATION IS A MECHANISM THROUGH WHICH WE CAN WRAPPING THE DATA & METHOD IN A SINGLE UNIT ( CLASS) . class
  • 12. DATA HIDING THE VARIABLES OF A CLASS WILL BE HIDDEN FROM OTHER CLASSES, AND CAN BE ACCESSED ONLY THROUGH THE METHODS OF THEIR CURRENT CLASS IS KNOWN AS DATA HIDING. DATA = PRIVATE METHOD = PUBLIC
  • 13. ABSTRACTION Design may be complex Keep interface simple Abstraction is the process of hiding certain details and showing only essential information to the user. ALLOW ONLY VERY IMPORTANT METHOD TO BE VISIBLE
  • 14. DESIGNING OR STRUCTURE OF CAR ENGINE BACKEND
  • 16. INHERITANCE USE THE EXISTING CLASS DESIGN AND ADD SOMETHING NEW. Inheritance in Java is a mechanism in which one object acquires all the properties and behaviors of a parent object. It is an important part of OOPs (Object Oriented programming system). YOU CAN REUSE METHODS AND FIELDS OF THE PARENT CLASS.
  • 17. CLASS ANIMAL{…..} CLASS CAT CAN EXTEND ANIMAL {…..} CLASS CROW CAN EXTENDS ANIMAL {……}
  • 18. POLYMORPHISM POLY MORPHISM MANY – MORE THAN ONE FORMS MANY FORMS POLYMORPHISM IS THE GREEK WORD WHOSE MEANING IS “ SAME OBJECT HAVING DIFFERENT BEHAVIOUR”.
  • 19. EXAMPLE PERSON FRIEND TEACHER STUDENT CUSTOMER 1. VOID PERSON (TEACHER). 2. VOID PERSON ( STUDENT) 3. VOID PERSON ( CUSTOMER) 4. VOID PERSON ( FRIENDS)