class and object in c++.pptx

Adarsh College, Hingoli
Adarsh College, HingoliAssistant Professor à 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 sur 8

Recommandé

Classes and objects par
Classes and objectsClasses and objects
Classes and objectsLovely Professional University
84 vues19 diapositives
Friend function par
Friend functionFriend function
Friend functionHeet Patel
107 vues11 diapositives
[OOP - Lec 06] Classes and Objects par
[OOP - Lec 06] Classes and Objects[OOP - Lec 06] Classes and Objects
[OOP - Lec 06] Classes and ObjectsMuhammad Hammad Waseem
349 vues17 diapositives
APL-2-classes and objects.ppt par
APL-2-classes and objects.pptAPL-2-classes and objects.ppt
APL-2-classes and objects.pptsrividyal2
8 vues52 diapositives
4 Classes & Objects par
4 Classes & Objects4 Classes & Objects
4 Classes & Objectspraveenjigajinni
1K vues49 diapositives

Contenu connexe

Similaire à class and object in c++.pptx

Oops par
OopsOops
OopsSankar Balasubramanian
1.8K vues27 diapositives
Object oriented programming par
Object oriented programmingObject oriented programming
Object oriented programmingbaabtra.com - No. 1 supplier of quality freshers
2.6K vues42 diapositives
Classes and objects par
Classes and objectsClasses and objects
Classes and objectsAnil Kumar
5.9K vues73 diapositives
Concept of Object-Oriented in C++ par
Concept of Object-Oriented in C++Concept of Object-Oriented in C++
Concept of Object-Oriented in C++Abdullah Jan
545 vues104 diapositives

Similaire à class and object in c++.pptx(20)

Classes and objects par Anil Kumar
Classes and objectsClasses and objects
Classes and objects
Anil Kumar5.9K vues
Concept of Object-Oriented in C++ par Abdullah Jan
Concept of Object-Oriented in C++Concept of Object-Oriented in C++
Concept of Object-Oriented in C++
Abdullah Jan545 vues
OOP Unit 2 - Classes and Object par dkpawar
OOP Unit 2 - Classes and ObjectOOP Unit 2 - Classes and Object
OOP Unit 2 - Classes and Object
dkpawar400 vues
Introduction to OOP with java par Sujit Kumar
Introduction to OOP with javaIntroduction to OOP with java
Introduction to OOP with java
Sujit Kumar149 vues
Overview of Object-Oriented Concepts Characteristics by vikas jagtap par 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 vues
Chapter18 class-and-objects par Deepak Singh
Chapter18 class-and-objectsChapter18 class-and-objects
Chapter18 class-and-objects
Deepak Singh155 vues
Learn C# Programming - Classes & Inheritance par Eng Teong Cheah
Learn C# Programming - Classes & InheritanceLearn C# Programming - Classes & Inheritance
Learn C# Programming - Classes & Inheritance
Eng Teong Cheah127 vues
Data members and member functions par Harsh Patel
Data members and member functionsData members and member functions
Data members and member functions
Harsh Patel10.3K vues

Plus de Adarsh College, Hingoli

microcontroller.pptx par
microcontroller.pptxmicrocontroller.pptx
microcontroller.pptxAdarsh College, Hingoli
14 vues17 diapositives
Microsoft Excell.pptx par
Microsoft Excell.pptxMicrosoft Excell.pptx
Microsoft Excell.pptxAdarsh College, Hingoli
29 vues32 diapositives
The 8086 microprocessor par
The  8086 microprocessorThe  8086 microprocessor
The 8086 microprocessorAdarsh College, Hingoli
83 vues27 diapositives
8051 Microcontroller par
8051 Microcontroller8051 Microcontroller
8051 MicrocontrollerAdarsh College, Hingoli
230 vues17 diapositives
Ms excel par
Ms excelMs excel
Ms excelAdarsh College, Hingoli
111 vues32 diapositives
DATABASE MANAGEMENT SYSTEM par
DATABASE MANAGEMENT SYSTEMDATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMAdarsh College, Hingoli
44 vues17 diapositives

Dernier

Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... par
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Moses Kemibaro
35 vues38 diapositives
Business Analyst Series 2023 - Week 4 Session 8 par
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8DianaGray10
145 vues13 diapositives
Mobile Core Solutions & Successful Cases.pdf par
Mobile Core Solutions & Successful Cases.pdfMobile Core Solutions & Successful Cases.pdf
Mobile Core Solutions & Successful Cases.pdfIPLOOK Networks
14 vues7 diapositives
KubeConNA23 Recap.pdf par
KubeConNA23 Recap.pdfKubeConNA23 Recap.pdf
KubeConNA23 Recap.pdfMichaelOLeary82
24 vues27 diapositives
Transcript: Redefining the book supply chain: A glimpse into the future - Tec... par
Transcript: Redefining the book supply chain: A glimpse into the future - Tec...Transcript: Redefining the book supply chain: A glimpse into the future - Tec...
Transcript: Redefining the book supply chain: A glimpse into the future - Tec...BookNet Canada
41 vues16 diapositives
Deep Tech and the Amplified Organisation: Core Concepts par
Deep Tech and the Amplified Organisation: Core ConceptsDeep Tech and the Amplified Organisation: Core Concepts
Deep Tech and the Amplified Organisation: Core ConceptsHolonomics
17 vues21 diapositives

Dernier(20)

Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... par Moses Kemibaro
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Moses Kemibaro35 vues
Business Analyst Series 2023 - Week 4 Session 8 par DianaGray10
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8
DianaGray10145 vues
Mobile Core Solutions & Successful Cases.pdf par IPLOOK Networks
Mobile Core Solutions & Successful Cases.pdfMobile Core Solutions & Successful Cases.pdf
Mobile Core Solutions & Successful Cases.pdf
IPLOOK Networks14 vues
Transcript: Redefining the book supply chain: A glimpse into the future - Tec... par BookNet Canada
Transcript: Redefining the book supply chain: A glimpse into the future - Tec...Transcript: Redefining the book supply chain: A glimpse into the future - Tec...
Transcript: Redefining the book supply chain: A glimpse into the future - Tec...
BookNet Canada41 vues
Deep Tech and the Amplified Organisation: Core Concepts par Holonomics
Deep Tech and the Amplified Organisation: Core ConceptsDeep Tech and the Amplified Organisation: Core Concepts
Deep Tech and the Amplified Organisation: Core Concepts
Holonomics17 vues
Initiating and Advancing Your Strategic GIS Governance Strategy par 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 vues
"Package management in monorepos", Zoltan Kochan par Fwdays
"Package management in monorepos", Zoltan Kochan"Package management in monorepos", Zoltan Kochan
"Package management in monorepos", Zoltan Kochan
Fwdays34 vues
This talk was not generated with ChatGPT: how AI is changing science par Elena Simperl
This talk was not generated with ChatGPT: how AI is changing scienceThis talk was not generated with ChatGPT: how AI is changing science
This talk was not generated with ChatGPT: how AI is changing science
Elena Simperl32 vues
Redefining the book supply chain: A glimpse into the future - Tech Forum 2023 par 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 vues
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」 par PC Cluster Consortium
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」
Optimizing Communication to Optimize Human Behavior - LCBM par Yaman Kumar
Optimizing Communication to Optimize Human Behavior - LCBMOptimizing Communication to Optimize Human Behavior - LCBM
Optimizing Communication to Optimize Human Behavior - LCBM
Yaman Kumar38 vues
"Node.js vs workers — A comparison of two JavaScript runtimes", James M Snell par Fwdays
"Node.js vs workers — A comparison of two JavaScript runtimes", James M Snell"Node.js vs workers — A comparison of two JavaScript runtimes", James M Snell
"Node.js vs workers — A comparison of two JavaScript runtimes", James M Snell
Fwdays14 vues
What is Authentication Active Directory_.pptx par HeenaMehta35
What is Authentication Active Directory_.pptxWhat is Authentication Active Directory_.pptx
What is Authentication Active Directory_.pptx
HeenaMehta3515 vues
Digital Personal Data Protection (DPDP) Practical Approach For CISOs par 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 vues
The Coming AI Tsunami.pptx par johnhandby
The Coming AI Tsunami.pptxThe Coming AI Tsunami.pptx
The Coming AI Tsunami.pptx
johnhandby13 vues

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.