class and object in c++.pptx

Adarsh College, Hingoli
Adarsh College, HingoliAssistant Professor en Adarsh College, Hingoli
Prof. R. S. Devhade
Assistant Professor, Department of Electronics
Adarsh College, Hingoli
Class
• A Class is a user-defined data type where we can bind data and its related functions
together. It allows the data and function to be hidden from external use or outside
the class.
• When defining a class, we are creating a new abstract data type that can be treated
like any other built in data type.
• Class is a group of objects that share common properties and relationships .
• In C++, a class is a new data type that contains member variables and member
functions that operates on the variables.
• A class is defined with the keyword class.
Syntax:
• The members that have been
declared as private can be accessed
only from with in the class.
• On the other hand , public members
can be accessed from outside the
class also.
• The data hiding is the key feature of
oops.
• The use of keywords private is
optional by default, the members of
a class are private.
• The variables declared inside the class are
known as data members and the functions are
known as members mid the functions.
• Only the member functions can have access to
the private data members and private
functions. However, the public members can
be accessed from the outside the class.
• The binding of data and functions together
into a single class type variable is referred to as
encapsulation.
Example:
Object
An object is an instance of a class. I simple words, we can say that an object is a variable of
type class.
The general syntax to create an object is:
classname object_name;
Once the object is created, it can be used to access the data members and functions of that
class.
Accessing the members of the class (data and functions) is done using the dot (.) operator,
which is also called as the member access operator.
class and object in c++.pptx
class and object in c++.pptx
THANK
YOU……
1 de 8

Recomendados

Classes and objects por
Classes and objectsClasses and objects
Classes and objectsLovely Professional University
84 vistas19 diapositivas
Friend function por
Friend functionFriend function
Friend functionHeet Patel
107 vistas11 diapositivas
[OOP - Lec 06] Classes and Objects por
[OOP - Lec 06] Classes and Objects[OOP - Lec 06] Classes and Objects
[OOP - Lec 06] Classes and ObjectsMuhammad Hammad Waseem
349 vistas17 diapositivas
APL-2-classes and objects.ppt por
APL-2-classes and objects.pptAPL-2-classes and objects.ppt
APL-2-classes and objects.pptsrividyal2
8 vistas52 diapositivas
4 Classes & Objects por
4 Classes & Objects4 Classes & Objects
4 Classes & Objectspraveenjigajinni
1K vistas49 diapositivas

Más contenido relacionado

Similar a class and object in c++.pptx

OOPS Characteristics por
OOPS CharacteristicsOOPS Characteristics
OOPS Characteristicsbaabtra.com - No. 1 supplier of quality freshers
21.1K vistas25 diapositivas
Oops por
OopsOops
OopsSankar Balasubramanian
1.8K vistas27 diapositivas
Object oriented programming por
Object oriented programmingObject oriented programming
Object oriented programmingbaabtra.com - No. 1 supplier of quality freshers
2.6K vistas42 diapositivas
Classes and objects por
Classes and objectsClasses and objects
Classes and objectsAnil Kumar
5.9K vistas73 diapositivas
Concept of Object-Oriented in C++ por
Concept of Object-Oriented in C++Concept of Object-Oriented in C++
Concept of Object-Oriented in C++Abdullah Jan
545 vistas104 diapositivas

Similar a class and object in c++.pptx(20)

Classes and objects por Anil Kumar
Classes and objectsClasses and objects
Classes and objects
Anil Kumar5.9K vistas
Concept of Object-Oriented in C++ por Abdullah Jan
Concept of Object-Oriented in C++Concept of Object-Oriented in C++
Concept of Object-Oriented in C++
Abdullah Jan545 vistas
oops-123991513147-phpapp02.pdf por ArpitaJana28
oops-123991513147-phpapp02.pdfoops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdf
ArpitaJana280 vistas
OOP Unit 2 - Classes and Object por dkpawar
OOP Unit 2 - Classes and ObjectOOP Unit 2 - Classes and Object
OOP Unit 2 - Classes and Object
dkpawar400 vistas
Introduction to OOP with java por Sujit Kumar
Introduction to OOP with javaIntroduction to OOP with java
Introduction to OOP with java
Sujit Kumar149 vistas
Overview of Object-Oriented Concepts Characteristics by vikas jagtap por Vikas Jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtapOverview of Object-Oriented Concepts Characteristics by vikas jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtap
Vikas Jagtap1.5K vistas
Chapter18 class-and-objects por Deepak Singh
Chapter18 class-and-objectsChapter18 class-and-objects
Chapter18 class-and-objects
Deepak Singh155 vistas
Learn C# Programming - Classes & Inheritance por Eng Teong Cheah
Learn C# Programming - Classes & InheritanceLearn C# Programming - Classes & Inheritance
Learn C# Programming - Classes & Inheritance
Eng Teong Cheah127 vistas
Data members and member functions por Harsh Patel
Data members and member functionsData members and member functions
Data members and member functions
Harsh Patel10.3K vistas

Más de Adarsh College, Hingoli

microcontroller.pptx por
microcontroller.pptxmicrocontroller.pptx
microcontroller.pptxAdarsh College, Hingoli
14 vistas17 diapositivas
Microsoft Excell.pptx por
Microsoft Excell.pptxMicrosoft Excell.pptx
Microsoft Excell.pptxAdarsh College, Hingoli
29 vistas32 diapositivas
The 8086 microprocessor por
The  8086 microprocessorThe  8086 microprocessor
The 8086 microprocessorAdarsh College, Hingoli
83 vistas27 diapositivas
8051 Microcontroller por
8051 Microcontroller8051 Microcontroller
8051 MicrocontrollerAdarsh College, Hingoli
230 vistas17 diapositivas
Ms excel por
Ms excelMs excel
Ms excelAdarsh College, Hingoli
111 vistas32 diapositivas
DATABASE MANAGEMENT SYSTEM por
DATABASE MANAGEMENT SYSTEMDATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMAdarsh College, Hingoli
44 vistas17 diapositivas

Último

AIM102-S_Cognizant_CognizantCognitive por
AIM102-S_Cognizant_CognizantCognitiveAIM102-S_Cognizant_CognizantCognitive
AIM102-S_Cognizant_CognizantCognitivePhilipBasford
21 vistas36 diapositivas
The Coming AI Tsunami.pptx por
The Coming AI Tsunami.pptxThe Coming AI Tsunami.pptx
The Coming AI Tsunami.pptxjohnhandby
13 vistas12 diapositivas
The Power of Generative AI in Accelerating No Code Adoption.pdf por
The Power of Generative AI in Accelerating No Code Adoption.pdfThe Power of Generative AI in Accelerating No Code Adoption.pdf
The Power of Generative AI in Accelerating No Code Adoption.pdfSaeed Al Dhaheri
39 vistas18 diapositivas
Measurecamp Brussels - Synthetic data.pdf por
Measurecamp Brussels - Synthetic data.pdfMeasurecamp Brussels - Synthetic data.pdf
Measurecamp Brussels - Synthetic data.pdfHuman37
26 vistas14 diapositivas
Telenity Solutions Brief por
Telenity Solutions BriefTelenity Solutions Brief
Telenity Solutions BriefMustafa Kuğu
14 vistas10 diapositivas
Cencora Executive Symposium por
Cencora Executive SymposiumCencora Executive Symposium
Cencora Executive Symposiummarketingcommunicati21
160 vistas14 diapositivas

Último(20)

AIM102-S_Cognizant_CognizantCognitive por PhilipBasford
AIM102-S_Cognizant_CognizantCognitiveAIM102-S_Cognizant_CognizantCognitive
AIM102-S_Cognizant_CognizantCognitive
PhilipBasford21 vistas
The Coming AI Tsunami.pptx por johnhandby
The Coming AI Tsunami.pptxThe Coming AI Tsunami.pptx
The Coming AI Tsunami.pptx
johnhandby13 vistas
The Power of Generative AI in Accelerating No Code Adoption.pdf por Saeed Al Dhaheri
The Power of Generative AI in Accelerating No Code Adoption.pdfThe Power of Generative AI in Accelerating No Code Adoption.pdf
The Power of Generative AI in Accelerating No Code Adoption.pdf
Saeed Al Dhaheri39 vistas
Measurecamp Brussels - Synthetic data.pdf por Human37
Measurecamp Brussels - Synthetic data.pdfMeasurecamp Brussels - Synthetic data.pdf
Measurecamp Brussels - Synthetic data.pdf
Human37 26 vistas
Mobile Core Solutions & Successful Cases.pdf por IPLOOK Networks
Mobile Core Solutions & Successful Cases.pdfMobile Core Solutions & Successful Cases.pdf
Mobile Core Solutions & Successful Cases.pdf
IPLOOK Networks14 vistas
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... por ShapeBlue
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
ShapeBlue108 vistas
Discover Aura Workshop (12.5.23).pdf por Neo4j
Discover Aura Workshop (12.5.23).pdfDiscover Aura Workshop (12.5.23).pdf
Discover Aura Workshop (12.5.23).pdf
Neo4j15 vistas
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... por The Digital Insurer
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...
The Power of Heat Decarbonisation Plans in the Built Environment por IES VE
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built Environment
IES VE84 vistas
"Surviving highload with Node.js", Andrii Shumada por Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays58 vistas
Redefining the book supply chain: A glimpse into the future - Tech Forum 2023 por BookNet Canada
Redefining the book supply chain: A glimpse into the future - Tech Forum 2023Redefining the book supply chain: A glimpse into the future - Tech Forum 2023
Redefining the book supply chain: A glimpse into the future - Tech Forum 2023
BookNet Canada44 vistas
Initiating and Advancing Your Strategic GIS Governance Strategy por Safe Software
Initiating and Advancing Your Strategic GIS Governance StrategyInitiating and Advancing Your Strategic GIS Governance Strategy
Initiating and Advancing Your Strategic GIS Governance Strategy
Safe Software184 vistas
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... por ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue199 vistas
Bronack Skills - Risk Management and SRE v1.0 12-3-2023.pdf por ThomasBronack
Bronack Skills - Risk Management and SRE v1.0 12-3-2023.pdfBronack Skills - Risk Management and SRE v1.0 12-3-2023.pdf
Bronack Skills - Risk Management and SRE v1.0 12-3-2023.pdf
ThomasBronack31 vistas
Digital Personal Data Protection (DPDP) Practical Approach For CISOs por Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash162 vistas

class and object in c++.pptx

  • 1. Prof. R. S. Devhade Assistant Professor, Department of Electronics Adarsh College, Hingoli
  • 2. Class • A Class is a user-defined data type where we can bind data and its related functions together. It allows the data and function to be hidden from external use or outside the class. • When defining a class, we are creating a new abstract data type that can be treated like any other built in data type. • Class is a group of objects that share common properties and relationships . • In C++, a class is a new data type that contains member variables and member functions that operates on the variables. • A class is defined with the keyword class.
  • 3. Syntax: • The members that have been declared as private can be accessed only from with in the class. • On the other hand , public members can be accessed from outside the class also. • The data hiding is the key feature of oops. • The use of keywords private is optional by default, the members of a class are private. • The variables declared inside the class are known as data members and the functions are known as members mid the functions. • Only the member functions can have access to the private data members and private functions. However, the public members can be accessed from the outside the class. • The binding of data and functions together into a single class type variable is referred to as encapsulation.
  • 5. Object An object is an instance of a class. I simple words, we can say that an object is a variable of type class. The general syntax to create an object is: classname object_name; Once the object is created, it can be used to access the data members and functions of that class. Accessing the members of the class (data and functions) is done using the dot (.) operator, which is also called as the member access operator.