class and object in c++.pptx

Adarsh College, Hingoli
Adarsh College, HingoliAssistant Professor em 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 visualizações19 slides
Classes and objects por
Classes and objectsClasses and objects
Classes and objectsbaabtra.com - No. 1 supplier of quality freshers
388 visualizações17 slides
Friend function por
Friend functionFriend function
Friend functionHeet Patel
106 visualizações11 slides
[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 visualizações17 slides
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 visualizações52 slides
4 Classes & Objects por
4 Classes & Objects4 Classes & Objects
4 Classes & Objectspraveenjigajinni
1K visualizações49 slides

Mais conteúdo 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 visualizações25 slides
Oops por
OopsOops
OopsSankar Balasubramanian
1.8K visualizações27 slides
Object oriented programming por
Object oriented programmingObject oriented programming
Object oriented programmingbaabtra.com - No. 1 supplier of quality freshers
2.6K visualizações42 slides
Classes and objects por
Classes and objectsClasses and objects
Classes and objectsAnil Kumar
5.9K visualizações73 slides
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 visualizações104 slides

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 visualizações
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 visualizações
oops-123991513147-phpapp02.pdf por ArpitaJana28
oops-123991513147-phpapp02.pdfoops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdf
ArpitaJana280 visão
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
dkpawar399 visualizações
Introduction to OOP with java por Sujit Kumar
Introduction to OOP with javaIntroduction to OOP with java
Introduction to OOP with java
Sujit Kumar149 visualizações
Classes and objects por Shailendra Veeru
Classes and objectsClasses and objects
Classes and objects
Shailendra Veeru2.6K visualizações
27c por Sireesh K
27c27c
27c
Sireesh K41 visualizações
27csharp por Sireesh K
27csharp27csharp
27csharp
Sireesh K38 visualizações
Oops por Jaya Kumari
OopsOops
Oops
Jaya Kumari42 visualizações
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 visualizações
Chapter18 class-and-objects por Deepak Singh
Chapter18 class-and-objectsChapter18 class-and-objects
Chapter18 class-and-objects
Deepak Singh155 visualizações
oopm 2.pdf por jayeshsoni49
oopm 2.pdfoopm 2.pdf
oopm 2.pdf
jayeshsoni496 visualizações
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 Cheah126 visualizações
Object oriented programming por Saiful Islam Sany
Object oriented programmingObject oriented programming
Object oriented programming
Saiful Islam Sany204 visualizações
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 visualizações

Mais de Adarsh College, Hingoli

microcontroller.pptx por
microcontroller.pptxmicrocontroller.pptx
microcontroller.pptxAdarsh College, Hingoli
14 visualizações17 slides
Microsoft Excell.pptx por
Microsoft Excell.pptxMicrosoft Excell.pptx
Microsoft Excell.pptxAdarsh College, Hingoli
28 visualizações32 slides
The 8086 microprocessor por
The  8086 microprocessorThe  8086 microprocessor
The 8086 microprocessorAdarsh College, Hingoli
78 visualizações27 slides
8051 Microcontroller por
8051 Microcontroller8051 Microcontroller
8051 MicrocontrollerAdarsh College, Hingoli
230 visualizações17 slides
Ms excel por
Ms excelMs excel
Ms excelAdarsh College, Hingoli
111 visualizações32 slides
DATABASE MANAGEMENT SYSTEM por
DATABASE MANAGEMENT SYSTEMDATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMAdarsh College, Hingoli
44 visualizações17 slides

Último

Business Analyst Series 2023 - Week 3 Session 5 por
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5DianaGray10
300 visualizações20 slides
Data Integrity for Banking and Financial Services por
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial ServicesPrecisely
25 visualizações26 slides
Info Session November 2023.pdf por
Info Session November 2023.pdfInfo Session November 2023.pdf
Info Session November 2023.pdfAleksandraKoprivica4
13 visualizações15 slides
Microsoft Power Platform.pptx por
Microsoft Power Platform.pptxMicrosoft Power Platform.pptx
Microsoft Power Platform.pptxUni Systems S.M.S.A.
53 visualizações38 slides
Vertical User Stories por
Vertical User StoriesVertical User Stories
Vertical User StoriesMoisés Armani Ramírez
14 visualizações16 slides
STPI OctaNE CoE Brochure.pdf por
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdfmadhurjyapb
14 visualizações1 slide

Último(20)

Business Analyst Series 2023 - Week 3 Session 5 por DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10300 visualizações
Data Integrity for Banking and Financial Services por Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely25 visualizações
Info Session November 2023.pdf por AleksandraKoprivica4
Info Session November 2023.pdfInfo Session November 2023.pdf
Info Session November 2023.pdf
AleksandraKoprivica413 visualizações
Microsoft Power Platform.pptx por Uni Systems S.M.S.A.
Microsoft Power Platform.pptxMicrosoft Power Platform.pptx
Microsoft Power Platform.pptx
Uni Systems S.M.S.A.53 visualizações
STPI OctaNE CoE Brochure.pdf por madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb14 visualizações
Mini-Track: AI and ML in Network Operations Applications por Network Automation Forum
Mini-Track: AI and ML in Network Operations ApplicationsMini-Track: AI and ML in Network Operations Applications
Mini-Track: AI and ML in Network Operations Applications
Network Automation Forum10 visualizações
Ransomware is Knocking your Door_Final.pdf por Security Bootcamp
Ransomware is Knocking your Door_Final.pdfRansomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdf
Security Bootcamp59 visualizações
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... por Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker40 visualizações
Network Source of Truth and Infrastructure as Code revisited por Network Automation Forum
Network Source of Truth and Infrastructure as Code revisitedNetwork Source of Truth and Infrastructure as Code revisited
Network Source of Truth and Infrastructure as Code revisited
Network Automation Forum27 visualizações
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... por TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc11 visualizações
Special_edition_innovator_2023.pdf por WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2218 visualizações
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... por Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
Jasper Oosterveld19 visualizações
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive por Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Network Automation Forum34 visualizações
"Running students' code in isolation. The hard way", Yurii Holiuk por Fwdays
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk
Fwdays17 visualizações
Uni Systems for Power Platform.pptx por Uni Systems S.M.S.A.
Uni Systems for Power Platform.pptxUni Systems for Power Platform.pptx
Uni Systems for Power Platform.pptx
Uni Systems S.M.S.A.56 visualizações
PharoJS - Zürich Smalltalk Group Meetup November 2023 por Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi132 visualizações
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors por sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab21 visualizações
Unit 1_Lecture 2_Physical Design of IoT.pdf por StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 visualizações

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.