SlideShare une entreprise Scribd logo
1  sur  7
GROUP 2: CLASSES
AND OBJECTS
PREPARED BY:
1. AAMINO
2. CABDULAHI
3. CABDISALAM
4. CABDIQAFAR
5. AXMED XIDIG
OBJECTS AND CLASSES
• Object − Objects have states and behaviors. Example: A
dog has states - color, name, breed as well as behaviors –
wagging the tail, barking, eating. An object is an instance
of a class.
• Class − A class can be defined as a template/blueprint
that describes the behavior/state that the object of its type
support.
OBJECTS
• Let us now look deep into what are objects. If we consider the real-world, we can find many
objects around us, cars, dogs, humans, etc. All these objects have a state and a behavior.
• If we consider a dog, then its state is - name, breed, color, and the behavior is - barking,
wagging the tail, running.
• If you compare the software object with a real-world object, they have very similar
characteristics.
• Software objects also have a state and a behavior. A software object's state is stored in fields
and behavior is shown via methods.
• So in software development, methods operate on the internal state of an object and the object-
to-object communication is done via methods.
DIFFERENCES B/W CLASSES AND OBJECTS
No
.
Object Class
1) Object is an instance of a class. Class is a blueprint or
template from which
objects are created.
2) Object is a real world entity such as pen,
laptop, mobile, bed, keyboard, mouse, chair
etc.
Class is a group of
similar objects.
3) Object is a physical entity. Class is a logical entity.
4) Object is created many times as per
requirement.
Class is declared once.
5) Object allocates memory when it is created. Class doesn't allocated
memory when it is
created.
CREATING CLASS IN C++
class Qof{
public:
string magac;
int da_da;
string jinsiga;
void shaqo() {
cout << “waan dhaqeeyaa” ;
}
void hurdo() {
}
void salaad_tukasho() {
}
}
CREATING OBJECTS IN C++
#include <iostream>
using namespace std;
int main () {
Qof aamino;
Qof cabdisalaam;
Qof Cabdiqafaar;
Qof Axmed_Xidig;
Qof Cabdulaahi;
aamino.magac = “aamino”;
aamino.da_da = 20;
aamino.jinsiga = “dhadig”;
aamino.shaqo();
}
SUMMARIZE
• A class is a user-defined type that describes
what a certain type of object will look like. A
class description consists of a declaration and a
definition. ... An object is a single instance of a
class. You can create many objects from the
same class type.

Contenu connexe

Similaire à classes and objects concepts.pptx

Objects and Classes in JAVA introduction
Objects and Classes in JAVA introductionObjects and Classes in JAVA introduction
Objects and Classes in JAVA introductionRadhika R
 
Object Oriented Programming Tutorial.pptx
Object Oriented Programming Tutorial.pptxObject Oriented Programming Tutorial.pptx
Object Oriented Programming Tutorial.pptxethiouniverse
 
JS-02-JavaScript-Objects.ppt
JS-02-JavaScript-Objects.pptJS-02-JavaScript-Objects.ppt
JS-02-JavaScript-Objects.pptMadhukarReddy74
 
Object-Oriented concepts.pptx
Object-Oriented concepts.pptxObject-Oriented concepts.pptx
Object-Oriented concepts.pptxBHARATH KUMAR
 
Object oriented programming CLASSES-AND-OBJECTS.pptx
Object oriented programming CLASSES-AND-OBJECTS.pptxObject oriented programming CLASSES-AND-OBJECTS.pptx
Object oriented programming CLASSES-AND-OBJECTS.pptxDaveEstonilo
 
[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOPMuhammad Hammad Waseem
 
Objects and Classes.pptx
Objects and Classes.pptxObjects and Classes.pptx
Objects and Classes.pptxBalasundaramSr
 
Objects and Classes.pptx
Objects and Classes.pptxObjects and Classes.pptx
Objects and Classes.pptxBalasundaramSr
 
Objects and Classes BRIEF.pptx
Objects and Classes BRIEF.pptxObjects and Classes BRIEF.pptx
Objects and Classes BRIEF.pptxBalasundaramSr
 

Similaire à classes and objects concepts.pptx (20)

Objects and Classes in JAVA introduction
Objects and Classes in JAVA introductionObjects and Classes in JAVA introduction
Objects and Classes in JAVA introduction
 
07 intro2 oop
07 intro2 oop07 intro2 oop
07 intro2 oop
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Object Oriented Programming Tutorial.pptx
Object Oriented Programming Tutorial.pptxObject Oriented Programming Tutorial.pptx
Object Oriented Programming Tutorial.pptx
 
Object concepts
Object conceptsObject concepts
Object concepts
 
JS-02-JavaScript-Objects.ppt
JS-02-JavaScript-Objects.pptJS-02-JavaScript-Objects.ppt
JS-02-JavaScript-Objects.ppt
 
Class and objects
Class and objectsClass and objects
Class and objects
 
O6u CS-315A OOP Lecture (1).pdf
O6u CS-315A OOP Lecture (1).pdfO6u CS-315A OOP Lecture (1).pdf
O6u CS-315A OOP Lecture (1).pdf
 
Basic concept of Object Oriented Programming
Basic concept of Object Oriented Programming Basic concept of Object Oriented Programming
Basic concept of Object Oriented Programming
 
Object-Oriented concepts.pptx
Object-Oriented concepts.pptxObject-Oriented concepts.pptx
Object-Oriented concepts.pptx
 
Object oriented programming CLASSES-AND-OBJECTS.pptx
Object oriented programming CLASSES-AND-OBJECTS.pptxObject oriented programming CLASSES-AND-OBJECTS.pptx
Object oriented programming CLASSES-AND-OBJECTS.pptx
 
OOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptxOOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptx
 
Concepts of oop1
Concepts of oop1Concepts of oop1
Concepts of oop1
 
[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP
 
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
 
Computer programming 2 Lesson 3
Computer programming 2  Lesson 3Computer programming 2  Lesson 3
Computer programming 2 Lesson 3
 
Objects and Classes.pptx
Objects and Classes.pptxObjects and Classes.pptx
Objects and Classes.pptx
 
Objects and Classes.pptx
Objects and Classes.pptxObjects and Classes.pptx
Objects and Classes.pptx
 
Objects and Classes BRIEF.pptx
Objects and Classes BRIEF.pptxObjects and Classes BRIEF.pptx
Objects and Classes BRIEF.pptx
 

Dernier

TransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRings
TransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRingsTransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRings
TransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRingsSérgio Sacani
 
Genome sequencing,shotgun sequencing.pptx
Genome sequencing,shotgun sequencing.pptxGenome sequencing,shotgun sequencing.pptx
Genome sequencing,shotgun sequencing.pptxSilpa
 
Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learninglevieagacer
 
Chemistry 5th semester paper 1st Notes.pdf
Chemistry 5th semester paper 1st Notes.pdfChemistry 5th semester paper 1st Notes.pdf
Chemistry 5th semester paper 1st Notes.pdfSumit Kumar yadav
 
Selaginella: features, morphology ,anatomy and reproduction.
Selaginella: features, morphology ,anatomy and reproduction.Selaginella: features, morphology ,anatomy and reproduction.
Selaginella: features, morphology ,anatomy and reproduction.Silpa
 
Digital Dentistry.Digital Dentistryvv.pptx
Digital Dentistry.Digital Dentistryvv.pptxDigital Dentistry.Digital Dentistryvv.pptx
Digital Dentistry.Digital Dentistryvv.pptxMohamedFarag457087
 
CYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptxCYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptxSilpa
 
Molecular markers- RFLP, RAPD, AFLP, SNP etc.
Molecular markers- RFLP, RAPD, AFLP, SNP etc.Molecular markers- RFLP, RAPD, AFLP, SNP etc.
Molecular markers- RFLP, RAPD, AFLP, SNP etc.Silpa
 
FAIRSpectra - Enabling the FAIRification of Analytical Science
FAIRSpectra - Enabling the FAIRification of Analytical ScienceFAIRSpectra - Enabling the FAIRification of Analytical Science
FAIRSpectra - Enabling the FAIRification of Analytical ScienceAlex Henderson
 
Phenolics: types, biosynthesis and functions.
Phenolics: types, biosynthesis and functions.Phenolics: types, biosynthesis and functions.
Phenolics: types, biosynthesis and functions.Silpa
 
Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.Silpa
 
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and SpectrometryFAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and SpectrometryAlex Henderson
 
POGONATUM : morphology, anatomy, reproduction etc.
POGONATUM : morphology, anatomy, reproduction etc.POGONATUM : morphology, anatomy, reproduction etc.
POGONATUM : morphology, anatomy, reproduction etc.Silpa
 
Zoology 5th semester notes( Sumit_yadav).pdf
Zoology 5th semester notes( Sumit_yadav).pdfZoology 5th semester notes( Sumit_yadav).pdf
Zoology 5th semester notes( Sumit_yadav).pdfSumit Kumar yadav
 
Atp synthase , Atp synthase complex 1 to 4.
Atp synthase , Atp synthase complex 1 to 4.Atp synthase , Atp synthase complex 1 to 4.
Atp synthase , Atp synthase complex 1 to 4.Silpa
 
Thyroid Physiology_Dr.E. Muralinath_ Associate Professor
Thyroid Physiology_Dr.E. Muralinath_ Associate ProfessorThyroid Physiology_Dr.E. Muralinath_ Associate Professor
Thyroid Physiology_Dr.E. Muralinath_ Associate Professormuralinath2
 
Dr. E. Muralinath_ Blood indices_clinical aspects
Dr. E. Muralinath_ Blood indices_clinical  aspectsDr. E. Muralinath_ Blood indices_clinical  aspects
Dr. E. Muralinath_ Blood indices_clinical aspectsmuralinath2
 

Dernier (20)

TransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRings
TransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRingsTransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRings
TransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRings
 
Genome sequencing,shotgun sequencing.pptx
Genome sequencing,shotgun sequencing.pptxGenome sequencing,shotgun sequencing.pptx
Genome sequencing,shotgun sequencing.pptx
 
Site Acceptance Test .
Site Acceptance Test                    .Site Acceptance Test                    .
Site Acceptance Test .
 
Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learning
 
Chemistry 5th semester paper 1st Notes.pdf
Chemistry 5th semester paper 1st Notes.pdfChemistry 5th semester paper 1st Notes.pdf
Chemistry 5th semester paper 1st Notes.pdf
 
Selaginella: features, morphology ,anatomy and reproduction.
Selaginella: features, morphology ,anatomy and reproduction.Selaginella: features, morphology ,anatomy and reproduction.
Selaginella: features, morphology ,anatomy and reproduction.
 
Digital Dentistry.Digital Dentistryvv.pptx
Digital Dentistry.Digital Dentistryvv.pptxDigital Dentistry.Digital Dentistryvv.pptx
Digital Dentistry.Digital Dentistryvv.pptx
 
CYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptxCYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptx
 
Molecular markers- RFLP, RAPD, AFLP, SNP etc.
Molecular markers- RFLP, RAPD, AFLP, SNP etc.Molecular markers- RFLP, RAPD, AFLP, SNP etc.
Molecular markers- RFLP, RAPD, AFLP, SNP etc.
 
PATNA CALL GIRLS 8617370543 LOW PRICE ESCORT SERVICE
PATNA CALL GIRLS 8617370543 LOW PRICE ESCORT SERVICEPATNA CALL GIRLS 8617370543 LOW PRICE ESCORT SERVICE
PATNA CALL GIRLS 8617370543 LOW PRICE ESCORT SERVICE
 
FAIRSpectra - Enabling the FAIRification of Analytical Science
FAIRSpectra - Enabling the FAIRification of Analytical ScienceFAIRSpectra - Enabling the FAIRification of Analytical Science
FAIRSpectra - Enabling the FAIRification of Analytical Science
 
Phenolics: types, biosynthesis and functions.
Phenolics: types, biosynthesis and functions.Phenolics: types, biosynthesis and functions.
Phenolics: types, biosynthesis and functions.
 
Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.
 
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and SpectrometryFAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
 
POGONATUM : morphology, anatomy, reproduction etc.
POGONATUM : morphology, anatomy, reproduction etc.POGONATUM : morphology, anatomy, reproduction etc.
POGONATUM : morphology, anatomy, reproduction etc.
 
Zoology 5th semester notes( Sumit_yadav).pdf
Zoology 5th semester notes( Sumit_yadav).pdfZoology 5th semester notes( Sumit_yadav).pdf
Zoology 5th semester notes( Sumit_yadav).pdf
 
Atp synthase , Atp synthase complex 1 to 4.
Atp synthase , Atp synthase complex 1 to 4.Atp synthase , Atp synthase complex 1 to 4.
Atp synthase , Atp synthase complex 1 to 4.
 
Thyroid Physiology_Dr.E. Muralinath_ Associate Professor
Thyroid Physiology_Dr.E. Muralinath_ Associate ProfessorThyroid Physiology_Dr.E. Muralinath_ Associate Professor
Thyroid Physiology_Dr.E. Muralinath_ Associate Professor
 
Dr. E. Muralinath_ Blood indices_clinical aspects
Dr. E. Muralinath_ Blood indices_clinical  aspectsDr. E. Muralinath_ Blood indices_clinical  aspects
Dr. E. Muralinath_ Blood indices_clinical aspects
 
Clean In Place(CIP).pptx .
Clean In Place(CIP).pptx                 .Clean In Place(CIP).pptx                 .
Clean In Place(CIP).pptx .
 

classes and objects concepts.pptx

  • 1. GROUP 2: CLASSES AND OBJECTS PREPARED BY: 1. AAMINO 2. CABDULAHI 3. CABDISALAM 4. CABDIQAFAR 5. AXMED XIDIG
  • 2. OBJECTS AND CLASSES • Object − Objects have states and behaviors. Example: A dog has states - color, name, breed as well as behaviors – wagging the tail, barking, eating. An object is an instance of a class. • Class − A class can be defined as a template/blueprint that describes the behavior/state that the object of its type support.
  • 3. OBJECTS • Let us now look deep into what are objects. If we consider the real-world, we can find many objects around us, cars, dogs, humans, etc. All these objects have a state and a behavior. • If we consider a dog, then its state is - name, breed, color, and the behavior is - barking, wagging the tail, running. • If you compare the software object with a real-world object, they have very similar characteristics. • Software objects also have a state and a behavior. A software object's state is stored in fields and behavior is shown via methods. • So in software development, methods operate on the internal state of an object and the object- to-object communication is done via methods.
  • 4. DIFFERENCES B/W CLASSES AND OBJECTS No . Object Class 1) Object is an instance of a class. Class is a blueprint or template from which objects are created. 2) Object is a real world entity such as pen, laptop, mobile, bed, keyboard, mouse, chair etc. Class is a group of similar objects. 3) Object is a physical entity. Class is a logical entity. 4) Object is created many times as per requirement. Class is declared once. 5) Object allocates memory when it is created. Class doesn't allocated memory when it is created.
  • 5. CREATING CLASS IN C++ class Qof{ public: string magac; int da_da; string jinsiga; void shaqo() { cout << “waan dhaqeeyaa” ; } void hurdo() { } void salaad_tukasho() { } }
  • 6. CREATING OBJECTS IN C++ #include <iostream> using namespace std; int main () { Qof aamino; Qof cabdisalaam; Qof Cabdiqafaar; Qof Axmed_Xidig; Qof Cabdulaahi; aamino.magac = “aamino”; aamino.da_da = 20; aamino.jinsiga = “dhadig”; aamino.shaqo(); }
  • 7. SUMMARIZE • A class is a user-defined type that describes what a certain type of object will look like. A class description consists of a declaration and a definition. ... An object is a single instance of a class. You can create many objects from the same class type.