SlideShare a Scribd company logo
1 of 4
#1: When to Use a struct vs
Class
#6: How would you count
the occurrences of a string
within a string?
#11: Encrypt/Decrypt a
String in .NET
#16: How do I Make a Texbox
that Only Accepts Numbers?
#2: How Does One Parse
XML Files?
#7: How to Check if a
Number is a Power of 2
#12: How do I Get the
Index of the Current
Iteration of a foreach
Loop?
#17: How do I Round a Decimal
Value to 2 Places for Output?
#3: What is the Difference
between String and string
#8: C# Loop – break vs
continue
#13: How to Get My Own
IP address in C#
#18: Remove Duplicates from
an Array
#4: How do I get the
Application’s Path in a C#
Console App?
#9: Difference Between
abstract and virtual
functions
#14: How do I Calculate
Someone’s Age in C#?
#19: How do I Sort a Dictionary
by Value?
#5: Calling base Constructor
in C#
#10: Difference Between ref
and out Keywords
#15: How do I get the
String Value of an enum?
#20: How Can I Return Multiple
Values From a Function in C#?
• structs are value types that can contain data and functions
• structs are value types and do not require heap allocation.
• structs directly store their data in the struct, classes store a reference to a dynamically allocated object.
• structs are useful for small data structures
• structs can affect performance
• Constructors are invoked with the new operator, but that does not allocate memory on the heap
• A struct constructor simply returns the struct value itself (typically in a temporary location on the stack),
and this value is then copied as necessary
• With classes, multiple variables may have a reference to the same object
• It is possible for operations on one variable to affect the object referenced by the other variable.
• With structs, the variables each have their own copy of the data, and it is not possible for operations on
one to affect the other.
• structs do not support user-specified inheritance, and they implicitly inherit from type object

More Related Content

What's hot (19)

Structure in C language
Structure in C languageStructure in C language
Structure in C language
 
Structure in C
Structure in CStructure in C
Structure in C
 
Structure in c
Structure in cStructure in c
Structure in c
 
C# program structure
C# program structureC# program structure
C# program structure
 
Unit 9. Structure and Unions
Unit 9. Structure and UnionsUnit 9. Structure and Unions
Unit 9. Structure and Unions
 
Presentation on c programing satcture
Presentation on c programing satcture Presentation on c programing satcture
Presentation on c programing satcture
 
Programming in C session 3
Programming in C session 3Programming in C session 3
Programming in C session 3
 
Structures in c language
Structures in c languageStructures in c language
Structures in c language
 
Structures
StructuresStructures
Structures
 
Structure in c
Structure in cStructure in c
Structure in c
 
Structures
StructuresStructures
Structures
 
Structure & Union in C++
Structure & Union in C++Structure & Union in C++
Structure & Union in C++
 
Basic of Structure,Structure members,Accessing Structure member,Nested Struct...
Basic of Structure,Structure members,Accessing Structure member,Nested Struct...Basic of Structure,Structure members,Accessing Structure member,Nested Struct...
Basic of Structure,Structure members,Accessing Structure member,Nested Struct...
 
Unit 4 qba
Unit 4 qbaUnit 4 qba
Unit 4 qba
 
Unit 4 qba
Unit 4 qbaUnit 4 qba
Unit 4 qba
 
Unit4 C
Unit4 C Unit4 C
Unit4 C
 
Structure & union
Structure & unionStructure & union
Structure & union
 
Structure in c#
Structure in c#Structure in c#
Structure in c#
 
C structure and union
C structure and unionC structure and union
C structure and union
 

Similar to Struct vs Class - Key Differences

Marco Mancuso - Data Context Interaction
Marco Mancuso - Data Context InteractionMarco Mancuso - Data Context Interaction
Marco Mancuso - Data Context InteractioncosenzaLab
 
ORM Concepts and JPA 2.0 Specifications
ORM Concepts and JPA 2.0 SpecificationsORM Concepts and JPA 2.0 Specifications
ORM Concepts and JPA 2.0 SpecificationsAhmed Ramzy
 
Tcs NQTExam technical questions
Tcs NQTExam technical questionsTcs NQTExam technical questions
Tcs NQTExam technical questionsAniketBhandare2
 
Concepts for Object Oriented Databases.ppt
Concepts for Object Oriented Databases.pptConcepts for Object Oriented Databases.ppt
Concepts for Object Oriented Databases.pptnafsigenet
 
Data massage! databases scaled from one to one million nodes (ulf wendel)
Data massage! databases scaled from one to one million nodes (ulf wendel)Data massage! databases scaled from one to one million nodes (ulf wendel)
Data massage! databases scaled from one to one million nodes (ulf wendel)Zhang Bo
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)MD Sulaiman
 
Chapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdfChapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdfTamiratDejene1
 
Dynamic Memory & Linked Lists
Dynamic Memory & Linked ListsDynamic Memory & Linked Lists
Dynamic Memory & Linked ListsAfaq Mansoor Khan
 
Cowboy way to iOS 8Presentation1
Cowboy way to iOS 8Presentation1Cowboy way to iOS 8Presentation1
Cowboy way to iOS 8Presentation1Carlo Bation
 
MIT302 Lesson 2_Advanced Database Systems.pptx
MIT302 Lesson 2_Advanced Database Systems.pptxMIT302 Lesson 2_Advanced Database Systems.pptx
MIT302 Lesson 2_Advanced Database Systems.pptxelsagalgao
 
C++ training
C++ training C++ training
C++ training PL Sharma
 
Structures unions
Structures  unionsStructures  unions
Structures unionsSugnan M
 
Domain oriented development
Domain oriented developmentDomain oriented development
Domain oriented developmentrajmundr
 
Style & Design Principles 02 - Design Patterns
Style & Design Principles 02 - Design PatternsStyle & Design Principles 02 - Design Patterns
Style & Design Principles 02 - Design PatternsNick Pruehs
 
All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbmsNaresh Kumar
 

Similar to Struct vs Class - Key Differences (20)

Marco Mancuso - Data Context Interaction
Marco Mancuso - Data Context InteractionMarco Mancuso - Data Context Interaction
Marco Mancuso - Data Context Interaction
 
ORM Concepts and JPA 2.0 Specifications
ORM Concepts and JPA 2.0 SpecificationsORM Concepts and JPA 2.0 Specifications
ORM Concepts and JPA 2.0 Specifications
 
Tcs NQTExam technical questions
Tcs NQTExam technical questionsTcs NQTExam technical questions
Tcs NQTExam technical questions
 
Concepts for Object Oriented Databases.ppt
Concepts for Object Oriented Databases.pptConcepts for Object Oriented Databases.ppt
Concepts for Object Oriented Databases.ppt
 
PPL, OQL & oodbms
PPL, OQL & oodbmsPPL, OQL & oodbms
PPL, OQL & oodbms
 
Data massage! databases scaled from one to one million nodes (ulf wendel)
Data massage! databases scaled from one to one million nodes (ulf wendel)Data massage! databases scaled from one to one million nodes (ulf wendel)
Data massage! databases scaled from one to one million nodes (ulf wendel)
 
01 objective-c session 1
01  objective-c session 101  objective-c session 1
01 objective-c session 1
 
80410172053.pdf
80410172053.pdf80410172053.pdf
80410172053.pdf
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)
 
Chapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdfChapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdf
 
Dynamic Memory & Linked Lists
Dynamic Memory & Linked ListsDynamic Memory & Linked Lists
Dynamic Memory & Linked Lists
 
Cowboy way to iOS 8Presentation1
Cowboy way to iOS 8Presentation1Cowboy way to iOS 8Presentation1
Cowboy way to iOS 8Presentation1
 
Ooad ch 2
Ooad ch 2Ooad ch 2
Ooad ch 2
 
MIT302 Lesson 2_Advanced Database Systems.pptx
MIT302 Lesson 2_Advanced Database Systems.pptxMIT302 Lesson 2_Advanced Database Systems.pptx
MIT302 Lesson 2_Advanced Database Systems.pptx
 
Data Structures & Algorithms
Data Structures & AlgorithmsData Structures & Algorithms
Data Structures & Algorithms
 
C++ training
C++ training C++ training
C++ training
 
Structures unions
Structures  unionsStructures  unions
Structures unions
 
Domain oriented development
Domain oriented developmentDomain oriented development
Domain oriented development
 
Style & Design Principles 02 - Design Patterns
Style & Design Principles 02 - Design PatternsStyle & Design Principles 02 - Design Patterns
Style & Design Principles 02 - Design Patterns
 
All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbms
 

More from Naman Kumar

Conic Sections- Circle, Parabola, Ellipse, Hyperbola
Conic Sections- Circle, Parabola, Ellipse, HyperbolaConic Sections- Circle, Parabola, Ellipse, Hyperbola
Conic Sections- Circle, Parabola, Ellipse, HyperbolaNaman Kumar
 
Research & Development - Major Organisations of India , R&D Importance and Role
Research & Development - Major Organisations of India , R&D Importance and RoleResearch & Development - Major Organisations of India , R&D Importance and Role
Research & Development - Major Organisations of India , R&D Importance and RoleNaman Kumar
 
The life of albert einstein ppt
The life of albert einstein ppt The life of albert einstein ppt
The life of albert einstein ppt Naman Kumar
 
Fifteen painted cards from a vampire tarot
Fifteen painted cards from a vampire tarotFifteen painted cards from a vampire tarot
Fifteen painted cards from a vampire tarotNaman Kumar
 
Smoke and mirrors by neil gaiman
Smoke and mirrors   by neil gaimanSmoke and mirrors   by neil gaiman
Smoke and mirrors by neil gaimanNaman Kumar
 
Windows 8 keys and acivator ..
Windows 8 keys and acivator .. Windows 8 keys and acivator ..
Windows 8 keys and acivator .. Naman Kumar
 
Dictionary of chemical formulas
Dictionary of chemical formulasDictionary of chemical formulas
Dictionary of chemical formulasNaman Kumar
 
Reactivity Series Of Metals
Reactivity Series Of Metals Reactivity Series Of Metals
Reactivity Series Of Metals Naman Kumar
 
Periodic table of elements - ( Science )
Periodic table of elements  - ( Science )Periodic table of elements  - ( Science )
Periodic table of elements - ( Science )Naman Kumar
 
The designer of the indian national flag
The designer of the indian national flagThe designer of the indian national flag
The designer of the indian national flagNaman Kumar
 

More from Naman Kumar (12)

Probability
ProbabilityProbability
Probability
 
Conic Sections- Circle, Parabola, Ellipse, Hyperbola
Conic Sections- Circle, Parabola, Ellipse, HyperbolaConic Sections- Circle, Parabola, Ellipse, Hyperbola
Conic Sections- Circle, Parabola, Ellipse, Hyperbola
 
Research & Development - Major Organisations of India , R&D Importance and Role
Research & Development - Major Organisations of India , R&D Importance and RoleResearch & Development - Major Organisations of India , R&D Importance and Role
Research & Development - Major Organisations of India , R&D Importance and Role
 
The life of albert einstein ppt
The life of albert einstein ppt The life of albert einstein ppt
The life of albert einstein ppt
 
Fifteen painted cards from a vampire tarot
Fifteen painted cards from a vampire tarotFifteen painted cards from a vampire tarot
Fifteen painted cards from a vampire tarot
 
Smoke and mirrors by neil gaiman
Smoke and mirrors   by neil gaimanSmoke and mirrors   by neil gaiman
Smoke and mirrors by neil gaiman
 
Windows 8 keys and acivator ..
Windows 8 keys and acivator .. Windows 8 keys and acivator ..
Windows 8 keys and acivator ..
 
Dictionary of chemical formulas
Dictionary of chemical formulasDictionary of chemical formulas
Dictionary of chemical formulas
 
Reactivity Series Of Metals
Reactivity Series Of Metals Reactivity Series Of Metals
Reactivity Series Of Metals
 
Periodic table of elements - ( Science )
Periodic table of elements  - ( Science )Periodic table of elements  - ( Science )
Periodic table of elements - ( Science )
 
Sikhism
SikhismSikhism
Sikhism
 
The designer of the indian national flag
The designer of the indian national flagThe designer of the indian national flag
The designer of the indian national flag
 

Recently uploaded

GLYCOSIDES Classification Of GLYCOSIDES Chemical Tests Glycosides
GLYCOSIDES Classification Of GLYCOSIDES  Chemical Tests GlycosidesGLYCOSIDES Classification Of GLYCOSIDES  Chemical Tests Glycosides
GLYCOSIDES Classification Of GLYCOSIDES Chemical Tests GlycosidesNandakishor Bhaurao Deshmukh
 
Observational constraints on mergers creating magnetism in massive stars
Observational constraints on mergers creating magnetism in massive starsObservational constraints on mergers creating magnetism in massive stars
Observational constraints on mergers creating magnetism in massive starsSérgio Sacani
 
bonjourmadame.tumblr.com bhaskar's girls
bonjourmadame.tumblr.com bhaskar's girlsbonjourmadame.tumblr.com bhaskar's girls
bonjourmadame.tumblr.com bhaskar's girlshansessene
 
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPirithiRaju
 
PROJECTILE MOTION-Horizontal and Vertical
PROJECTILE MOTION-Horizontal and VerticalPROJECTILE MOTION-Horizontal and Vertical
PROJECTILE MOTION-Horizontal and VerticalMAESTRELLAMesa2
 
Thermodynamics ,types of system,formulae ,gibbs free energy .pptx
Thermodynamics ,types of system,formulae ,gibbs free energy .pptxThermodynamics ,types of system,formulae ,gibbs free energy .pptx
Thermodynamics ,types of system,formulae ,gibbs free energy .pptxuniversity
 
Vision and reflection on Mining Software Repositories research in 2024
Vision and reflection on Mining Software Repositories research in 2024Vision and reflection on Mining Software Repositories research in 2024
Vision and reflection on Mining Software Repositories research in 2024AyushiRastogi48
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPirithiRaju
 
Introduction of Human Body & Structure of cell.pptx
Introduction of Human Body & Structure of cell.pptxIntroduction of Human Body & Structure of cell.pptx
Introduction of Human Body & Structure of cell.pptxMedical College
 
Pests of castor_Binomics_Identification_Dr.UPR.pdf
Pests of castor_Binomics_Identification_Dr.UPR.pdfPests of castor_Binomics_Identification_Dr.UPR.pdf
Pests of castor_Binomics_Identification_Dr.UPR.pdfPirithiRaju
 
User Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather StationUser Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather StationColumbia Weather Systems
 
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxSTOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxMurugaveni B
 
Citronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayCitronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayupadhyaymani499
 
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》rnrncn29
 
GenAI talk for Young at Wageningen University & Research (WUR) March 2024
GenAI talk for Young at Wageningen University & Research (WUR) March 2024GenAI talk for Young at Wageningen University & Research (WUR) March 2024
GenAI talk for Young at Wageningen University & Research (WUR) March 2024Jene van der Heide
 
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...Universidade Federal de Sergipe - UFS
 
Harmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms PresentationHarmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms Presentationtahreemzahra82
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxpriyankatabhane
 
Topic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptxTopic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptxJorenAcuavera1
 

Recently uploaded (20)

GLYCOSIDES Classification Of GLYCOSIDES Chemical Tests Glycosides
GLYCOSIDES Classification Of GLYCOSIDES  Chemical Tests GlycosidesGLYCOSIDES Classification Of GLYCOSIDES  Chemical Tests Glycosides
GLYCOSIDES Classification Of GLYCOSIDES Chemical Tests Glycosides
 
Observational constraints on mergers creating magnetism in massive stars
Observational constraints on mergers creating magnetism in massive starsObservational constraints on mergers creating magnetism in massive stars
Observational constraints on mergers creating magnetism in massive stars
 
bonjourmadame.tumblr.com bhaskar's girls
bonjourmadame.tumblr.com bhaskar's girlsbonjourmadame.tumblr.com bhaskar's girls
bonjourmadame.tumblr.com bhaskar's girls
 
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
 
PROJECTILE MOTION-Horizontal and Vertical
PROJECTILE MOTION-Horizontal and VerticalPROJECTILE MOTION-Horizontal and Vertical
PROJECTILE MOTION-Horizontal and Vertical
 
Thermodynamics ,types of system,formulae ,gibbs free energy .pptx
Thermodynamics ,types of system,formulae ,gibbs free energy .pptxThermodynamics ,types of system,formulae ,gibbs free energy .pptx
Thermodynamics ,types of system,formulae ,gibbs free energy .pptx
 
Vision and reflection on Mining Software Repositories research in 2024
Vision and reflection on Mining Software Repositories research in 2024Vision and reflection on Mining Software Repositories research in 2024
Vision and reflection on Mining Software Repositories research in 2024
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdf
 
Introduction of Human Body & Structure of cell.pptx
Introduction of Human Body & Structure of cell.pptxIntroduction of Human Body & Structure of cell.pptx
Introduction of Human Body & Structure of cell.pptx
 
Pests of castor_Binomics_Identification_Dr.UPR.pdf
Pests of castor_Binomics_Identification_Dr.UPR.pdfPests of castor_Binomics_Identification_Dr.UPR.pdf
Pests of castor_Binomics_Identification_Dr.UPR.pdf
 
User Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather StationUser Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather Station
 
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxSTOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
 
Citronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayCitronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyay
 
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
 
GenAI talk for Young at Wageningen University & Research (WUR) March 2024
GenAI talk for Young at Wageningen University & Research (WUR) March 2024GenAI talk for Young at Wageningen University & Research (WUR) March 2024
GenAI talk for Young at Wageningen University & Research (WUR) March 2024
 
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
 
Harmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms PresentationHarmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms Presentation
 
Let’s Say Someone Did Drop the Bomb. Then What?
Let’s Say Someone Did Drop the Bomb. Then What?Let’s Say Someone Did Drop the Bomb. Then What?
Let’s Say Someone Did Drop the Bomb. Then What?
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptx
 
Topic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptxTopic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptx
 

Struct vs Class - Key Differences

  • 1.
  • 2. #1: When to Use a struct vs Class #6: How would you count the occurrences of a string within a string? #11: Encrypt/Decrypt a String in .NET #16: How do I Make a Texbox that Only Accepts Numbers? #2: How Does One Parse XML Files? #7: How to Check if a Number is a Power of 2 #12: How do I Get the Index of the Current Iteration of a foreach Loop? #17: How do I Round a Decimal Value to 2 Places for Output? #3: What is the Difference between String and string #8: C# Loop – break vs continue #13: How to Get My Own IP address in C# #18: Remove Duplicates from an Array #4: How do I get the Application’s Path in a C# Console App? #9: Difference Between abstract and virtual functions #14: How do I Calculate Someone’s Age in C#? #19: How do I Sort a Dictionary by Value? #5: Calling base Constructor in C# #10: Difference Between ref and out Keywords #15: How do I get the String Value of an enum? #20: How Can I Return Multiple Values From a Function in C#?
  • 3. • structs are value types that can contain data and functions • structs are value types and do not require heap allocation. • structs directly store their data in the struct, classes store a reference to a dynamically allocated object. • structs are useful for small data structures • structs can affect performance • Constructors are invoked with the new operator, but that does not allocate memory on the heap • A struct constructor simply returns the struct value itself (typically in a temporary location on the stack), and this value is then copied as necessary
  • 4. • With classes, multiple variables may have a reference to the same object • It is possible for operations on one variable to affect the object referenced by the other variable. • With structs, the variables each have their own copy of the data, and it is not possible for operations on one to affect the other. • structs do not support user-specified inheritance, and they implicitly inherit from type object