SlideShare a Scribd company logo
1) What is the difference between a class and an instance of a class? Give an example.
2) What is information hiding, and how is it implemented in C++?
3) What is operator overloading, and how is it implemented in C++?
4) What is a friend function? What is the difference between a friend function and a regular
member function of a class?
Solution
A class defines the attributes and behaviour of an object. it is used as a template that hels in
creating an object.
the attributes are called data members and the behaviors are called methods.
Class variables only have one copy that is shared by all the different objects of a class,
Object has its own copy of an instance variable. For different object can have different instance
variables, where as class variables across different objects can have only one value.
class EMP{// here is employee class
public:
datatype name1// example int num
datatype name1// example double salary
};
EMP emp1;// declare emp1 type EMP
a class provides a blue print for objcet. object is an istance of a class

More Related Content

Similar to 1) What is the difference between a class and an instance of a class.pdf

Java interview questions
Java interview questionsJava interview questions
Java interview questions
Shashwat Shriparv
 
Java chapter 5
Java chapter 5Java chapter 5
Java chapter 5
Abdii Rashid
 
Oops
OopsOops
Basics of oops concept
Basics of oops conceptBasics of oops concept
Basics of oops concept
DINESH KUMAR ARIVARASAN
 
Faqs in java
Faqs in javaFaqs in java
Faqs in java
prathap kumar
 
OOP
OOPOOP
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
Praveen Chowdary
 
2.oop concept
2.oop concept2.oop concept
2.oop concept
Robbie AkaChopa
 
OOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptxOOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptx
ShobhitSrivastava15887
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
mustafa sarac
 
My c++
My c++My c++
My c++
snathick
 
oops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdfoops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdf
ArpitaJana28
 
Java_Interview Qns
Java_Interview QnsJava_Interview Qns
Java_Interview Qns
ManikandanRamanujam
 
Java and its concepts
Java and its conceptsJava and its concepts
Java and its concepts
aashukaushik
 
OOP interview questions & answers.
OOP interview questions & answers.OOP interview questions & answers.
OOP interview questions & answers.
Questpond
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfL1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdf
BhanuJatinSingh
 
JAVA-PPT'S.pdf
JAVA-PPT'S.pdfJAVA-PPT'S.pdf
JAVA-PPT'S.pdf
AnmolVerma363503
 
Md02 - Getting Started part-2
Md02 - Getting Started part-2Md02 - Getting Started part-2
Md02 - Getting Started part-2
Rakesh Madugula
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Saiful Islam Sany
 
Data Structure Interview Questions & Answers
Data Structure Interview Questions & AnswersData Structure Interview Questions & Answers
Data Structure Interview Questions & Answers
Satyam Jaiswal
 

Similar to 1) What is the difference between a class and an instance of a class.pdf (20)

Java interview questions
Java interview questionsJava interview questions
Java interview questions
 
Java chapter 5
Java chapter 5Java chapter 5
Java chapter 5
 
Oops
OopsOops
Oops
 
Basics of oops concept
Basics of oops conceptBasics of oops concept
Basics of oops concept
 
Faqs in java
Faqs in javaFaqs in java
Faqs in java
 
OOP
OOPOOP
OOP
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
 
2.oop concept
2.oop concept2.oop concept
2.oop concept
 
OOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptxOOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptx
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
My c++
My c++My c++
My c++
 
oops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdfoops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdf
 
Java_Interview Qns
Java_Interview QnsJava_Interview Qns
Java_Interview Qns
 
Java and its concepts
Java and its conceptsJava and its concepts
Java and its concepts
 
OOP interview questions & answers.
OOP interview questions & answers.OOP interview questions & answers.
OOP interview questions & answers.
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfL1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdf
 
JAVA-PPT'S.pdf
JAVA-PPT'S.pdfJAVA-PPT'S.pdf
JAVA-PPT'S.pdf
 
Md02 - Getting Started part-2
Md02 - Getting Started part-2Md02 - Getting Started part-2
Md02 - Getting Started part-2
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Data Structure Interview Questions & Answers
Data Structure Interview Questions & AnswersData Structure Interview Questions & Answers
Data Structure Interview Questions & Answers
 

More from SALES97

Blossom Corporation had 120,000 common shares outstanding on Decembe.pdf
Blossom Corporation had 120,000 common shares outstanding on Decembe.pdfBlossom Corporation had 120,000 common shares outstanding on Decembe.pdf
Blossom Corporation had 120,000 common shares outstanding on Decembe.pdf
SALES97
 
A system experiences a phase change from liquid to solid. Is this exo.pdf
A system experiences a phase change from liquid to solid. Is this exo.pdfA system experiences a phase change from liquid to solid. Is this exo.pdf
A system experiences a phase change from liquid to solid. Is this exo.pdf
SALES97
 
Write an equation of a tangent function with the following characters.pdf
Write an equation of a tangent function with the following characters.pdfWrite an equation of a tangent function with the following characters.pdf
Write an equation of a tangent function with the following characters.pdf
SALES97
 
Why is a mixture of alcohol and water used, rather than simply water.pdf
Why is a mixture of alcohol and water used, rather than simply water.pdfWhy is a mixture of alcohol and water used, rather than simply water.pdf
Why is a mixture of alcohol and water used, rather than simply water.pdf
SALES97
 
Why are the 1960s relatively turbulentSolutionAnswer1960s .pdf
Why are the 1960s relatively turbulentSolutionAnswer1960s .pdfWhy are the 1960s relatively turbulentSolutionAnswer1960s .pdf
Why are the 1960s relatively turbulentSolutionAnswer1960s .pdf
SALES97
 
When acting as a neurotransmitter NO binds to the iron atom in vario.pdf
When acting as a neurotransmitter NO binds to the iron atom in vario.pdfWhen acting as a neurotransmitter NO binds to the iron atom in vario.pdf
When acting as a neurotransmitter NO binds to the iron atom in vario.pdf
SALES97
 
Which of the following are reasons that Drosophila are an ideal exper.pdf
Which of the following are reasons that Drosophila are an ideal exper.pdfWhich of the following are reasons that Drosophila are an ideal exper.pdf
Which of the following are reasons that Drosophila are an ideal exper.pdf
SALES97
 
What Michael acceptor is needed for the conjugate addition Beta - .pdf
What Michael acceptor is needed for the conjugate addition  Beta - .pdfWhat Michael acceptor is needed for the conjugate addition  Beta - .pdf
What Michael acceptor is needed for the conjugate addition Beta - .pdf
SALES97
 
What is the role of intuition in decision-makingSolutionIntui.pdf
What is the role of intuition in decision-makingSolutionIntui.pdfWhat is the role of intuition in decision-makingSolutionIntui.pdf
What is the role of intuition in decision-makingSolutionIntui.pdf
SALES97
 
What is the difference between a HTML element’s id attribute and nam.pdf
What is the difference between a HTML element’s id attribute and nam.pdfWhat is the difference between a HTML element’s id attribute and nam.pdf
What is the difference between a HTML element’s id attribute and nam.pdf
SALES97
 
What happens when youre Running Scripts without a console in Linux.pdf
What happens when youre Running Scripts without a console in Linux.pdfWhat happens when youre Running Scripts without a console in Linux.pdf
What happens when youre Running Scripts without a console in Linux.pdf
SALES97
 
TrueFalse A virtual private network is a way to use the Internet to.pdf
TrueFalse  A virtual private network is a way to use the Internet to.pdfTrueFalse  A virtual private network is a way to use the Internet to.pdf
TrueFalse A virtual private network is a way to use the Internet to.pdf
SALES97
 
The total physical units accounted for is the sum of the units co.pdf
The total physical units accounted for is the sum of the units co.pdfThe total physical units accounted for is the sum of the units co.pdf
The total physical units accounted for is the sum of the units co.pdf
SALES97
 
The problem can be found below. I would like someone to run this. I .pdf
The problem can be found below. I would like someone to run this. I .pdfThe problem can be found below. I would like someone to run this. I .pdf
The problem can be found below. I would like someone to run this. I .pdf
SALES97
 
The probability that a teacher will give an unannounced test duri.pdf
The probability that a teacher will give an unannounced test duri.pdfThe probability that a teacher will give an unannounced test duri.pdf
The probability that a teacher will give an unannounced test duri.pdf
SALES97
 
The Orlando MedicalOrlando Medical Corporation financial statements.pdf
The Orlando MedicalOrlando Medical Corporation financial statements.pdfThe Orlando MedicalOrlando Medical Corporation financial statements.pdf
The Orlando MedicalOrlando Medical Corporation financial statements.pdf
SALES97
 
The IP network is a virtual network and must rely on a link layer ne.pdf
The IP network is a virtual network and must rely on a link layer ne.pdfThe IP network is a virtual network and must rely on a link layer ne.pdf
The IP network is a virtual network and must rely on a link layer ne.pdf
SALES97
 
Table 1 Endowment of Labor and Capital US 100 20 Canada 10 Workers Ma.pdf
Table 1 Endowment of Labor and Capital US 100 20 Canada 10 Workers Ma.pdfTable 1 Endowment of Labor and Capital US 100 20 Canada 10 Workers Ma.pdf
Table 1 Endowment of Labor and Capital US 100 20 Canada 10 Workers Ma.pdf
SALES97
 
State if you agree or disagree with the statement made and whyLes.pdf
State if you agree or disagree with the statement made and whyLes.pdfState if you agree or disagree with the statement made and whyLes.pdf
State if you agree or disagree with the statement made and whyLes.pdf
SALES97
 
subject.....project management.Tools and Processes Based on the pr.pdf
subject.....project management.Tools and Processes Based on the pr.pdfsubject.....project management.Tools and Processes Based on the pr.pdf
subject.....project management.Tools and Processes Based on the pr.pdf
SALES97
 

More from SALES97 (20)

Blossom Corporation had 120,000 common shares outstanding on Decembe.pdf
Blossom Corporation had 120,000 common shares outstanding on Decembe.pdfBlossom Corporation had 120,000 common shares outstanding on Decembe.pdf
Blossom Corporation had 120,000 common shares outstanding on Decembe.pdf
 
A system experiences a phase change from liquid to solid. Is this exo.pdf
A system experiences a phase change from liquid to solid. Is this exo.pdfA system experiences a phase change from liquid to solid. Is this exo.pdf
A system experiences a phase change from liquid to solid. Is this exo.pdf
 
Write an equation of a tangent function with the following characters.pdf
Write an equation of a tangent function with the following characters.pdfWrite an equation of a tangent function with the following characters.pdf
Write an equation of a tangent function with the following characters.pdf
 
Why is a mixture of alcohol and water used, rather than simply water.pdf
Why is a mixture of alcohol and water used, rather than simply water.pdfWhy is a mixture of alcohol and water used, rather than simply water.pdf
Why is a mixture of alcohol and water used, rather than simply water.pdf
 
Why are the 1960s relatively turbulentSolutionAnswer1960s .pdf
Why are the 1960s relatively turbulentSolutionAnswer1960s .pdfWhy are the 1960s relatively turbulentSolutionAnswer1960s .pdf
Why are the 1960s relatively turbulentSolutionAnswer1960s .pdf
 
When acting as a neurotransmitter NO binds to the iron atom in vario.pdf
When acting as a neurotransmitter NO binds to the iron atom in vario.pdfWhen acting as a neurotransmitter NO binds to the iron atom in vario.pdf
When acting as a neurotransmitter NO binds to the iron atom in vario.pdf
 
Which of the following are reasons that Drosophila are an ideal exper.pdf
Which of the following are reasons that Drosophila are an ideal exper.pdfWhich of the following are reasons that Drosophila are an ideal exper.pdf
Which of the following are reasons that Drosophila are an ideal exper.pdf
 
What Michael acceptor is needed for the conjugate addition Beta - .pdf
What Michael acceptor is needed for the conjugate addition  Beta - .pdfWhat Michael acceptor is needed for the conjugate addition  Beta - .pdf
What Michael acceptor is needed for the conjugate addition Beta - .pdf
 
What is the role of intuition in decision-makingSolutionIntui.pdf
What is the role of intuition in decision-makingSolutionIntui.pdfWhat is the role of intuition in decision-makingSolutionIntui.pdf
What is the role of intuition in decision-makingSolutionIntui.pdf
 
What is the difference between a HTML element’s id attribute and nam.pdf
What is the difference between a HTML element’s id attribute and nam.pdfWhat is the difference between a HTML element’s id attribute and nam.pdf
What is the difference between a HTML element’s id attribute and nam.pdf
 
What happens when youre Running Scripts without a console in Linux.pdf
What happens when youre Running Scripts without a console in Linux.pdfWhat happens when youre Running Scripts without a console in Linux.pdf
What happens when youre Running Scripts without a console in Linux.pdf
 
TrueFalse A virtual private network is a way to use the Internet to.pdf
TrueFalse  A virtual private network is a way to use the Internet to.pdfTrueFalse  A virtual private network is a way to use the Internet to.pdf
TrueFalse A virtual private network is a way to use the Internet to.pdf
 
The total physical units accounted for is the sum of the units co.pdf
The total physical units accounted for is the sum of the units co.pdfThe total physical units accounted for is the sum of the units co.pdf
The total physical units accounted for is the sum of the units co.pdf
 
The problem can be found below. I would like someone to run this. I .pdf
The problem can be found below. I would like someone to run this. I .pdfThe problem can be found below. I would like someone to run this. I .pdf
The problem can be found below. I would like someone to run this. I .pdf
 
The probability that a teacher will give an unannounced test duri.pdf
The probability that a teacher will give an unannounced test duri.pdfThe probability that a teacher will give an unannounced test duri.pdf
The probability that a teacher will give an unannounced test duri.pdf
 
The Orlando MedicalOrlando Medical Corporation financial statements.pdf
The Orlando MedicalOrlando Medical Corporation financial statements.pdfThe Orlando MedicalOrlando Medical Corporation financial statements.pdf
The Orlando MedicalOrlando Medical Corporation financial statements.pdf
 
The IP network is a virtual network and must rely on a link layer ne.pdf
The IP network is a virtual network and must rely on a link layer ne.pdfThe IP network is a virtual network and must rely on a link layer ne.pdf
The IP network is a virtual network and must rely on a link layer ne.pdf
 
Table 1 Endowment of Labor and Capital US 100 20 Canada 10 Workers Ma.pdf
Table 1 Endowment of Labor and Capital US 100 20 Canada 10 Workers Ma.pdfTable 1 Endowment of Labor and Capital US 100 20 Canada 10 Workers Ma.pdf
Table 1 Endowment of Labor and Capital US 100 20 Canada 10 Workers Ma.pdf
 
State if you agree or disagree with the statement made and whyLes.pdf
State if you agree or disagree with the statement made and whyLes.pdfState if you agree or disagree with the statement made and whyLes.pdf
State if you agree or disagree with the statement made and whyLes.pdf
 
subject.....project management.Tools and Processes Based on the pr.pdf
subject.....project management.Tools and Processes Based on the pr.pdfsubject.....project management.Tools and Processes Based on the pr.pdf
subject.....project management.Tools and Processes Based on the pr.pdf
 

Recently uploaded

PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
sayalidalavi006
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 

Recently uploaded (20)

PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 

1) What is the difference between a class and an instance of a class.pdf

  • 1. 1) What is the difference between a class and an instance of a class? Give an example. 2) What is information hiding, and how is it implemented in C++? 3) What is operator overloading, and how is it implemented in C++? 4) What is a friend function? What is the difference between a friend function and a regular member function of a class? Solution A class defines the attributes and behaviour of an object. it is used as a template that hels in creating an object. the attributes are called data members and the behaviors are called methods. Class variables only have one copy that is shared by all the different objects of a class, Object has its own copy of an instance variable. For different object can have different instance variables, where as class variables across different objects can have only one value. class EMP{// here is employee class public: datatype name1// example int num datatype name1// example double salary }; EMP emp1;// declare emp1 type EMP a class provides a blue print for objcet. object is an istance of a class