SlideShare a Scribd company logo
1 of 9
By Komal Jain
Common Type System
 The common type system defines how types are declared,
used, and managed in the common language runtime, and
is also an important part of the runtime's support for cross-
language integration.
 The common type system performs the following
functions
 Establishes a framework that helps enable cross-language
integration, type safety, and high-performance code
execution.
 Provides a library that contains the primitive data types
(such as Boolean, Byte, Char, Int32, and UInt64) used in
application development.
Value types and Reference types
 C# divides the world of types into value types and reference
types. Value types are created on the stack. All the intrinsic
types (int ,long) are value types and thus are created on the
stack.
 Objects on the other hand, are reference types. Reference
types are created on an undifferentiated block of memory
known as the heap.
 Structs, types such as int, float, long etc are value types.
 Strings are reference types.
 Memory of reference types is claimed by garbage collector.
C# Data
Type
Value
Types
Predefined
User
Defined
Reference
Type
Predefined
User
Defined
Characters
Integers
Booleans
Structures
Enumeration
Objects
Strings
Classes
Arrays
Delegates
Interfaces
Value Types
 Value type variables can be assigned a value directly.
They are derived from the class System.ValueType.
 The value types directly contain data. Some examples
are int, char, and float, which stores numbers,
alphabets, and floating point numbers, respectively.
When you declare an int type, the system allocates
memory to store the value.
C# Memory Range
int 4 bytes –2147483648 to 2147483647
long 8 bytes –9223372036854775808 to 9223372036854775807
byte 1 byte 0 to 255
float 4 bytes –1.5x10-45 to 3.4 x x1038
double 8 bytes –5.0x10-324 to 1.7x10308
char 2 bytes Unicode characters
boolean 1 byte True or false
Predefined Data Types
Reference Types
 The Reference type variable is such type of variable in
C# that holds the reference of memory address instead
of value.
Reference
Type
Class
Type
Type
name
Object String
Interface
Type
Array
Delegate
Type
For example, consider following string variable:
string s = "Hello World!!";
The following image shows how the system allocates the
memory for the above string variable.
Memory allocation for Reference typeAs you can see in the
above image, the system selects a random location in
memory (0x803200) for the variable 's'. The value of a
variable s is 0x600000 which is the memory address of the
actual data value. Thus, reference type stores the address of
the location where the actual value is stored instead of
value itself.
References
 http://www.tutorialspoint.com
 http://www.tutorialsteacher.com
 https://www.youtube.com/watch?v=NbucRONDb78
Thank You

More Related Content

What's hot (19)

CIS 1403 Lab 2- Data Types and Variables
CIS 1403 Lab 2- Data Types and VariablesCIS 1403 Lab 2- Data Types and Variables
CIS 1403 Lab 2- Data Types and Variables
 
Advanced software engineering lab 2
Advanced software engineering lab 2Advanced software engineering lab 2
Advanced software engineering lab 2
 
Data types
Data typesData types
Data types
 
Java basic data types
Java basic data typesJava basic data types
Java basic data types
 
Introduction
IntroductionIntroduction
Introduction
 
Data types in c++
Data types in c++Data types in c++
Data types in c++
 
Iostreams
IostreamsIostreams
Iostreams
 
Java Data Types
Java Data TypesJava Data Types
Java Data Types
 
Hema wt (1)
Hema wt (1)Hema wt (1)
Hema wt (1)
 
LEARN C# PROGRAMMING WITH GMT
LEARN C# PROGRAMMING WITH GMTLEARN C# PROGRAMMING WITH GMT
LEARN C# PROGRAMMING WITH GMT
 
java programming basics - part ii
 java programming basics - part ii java programming basics - part ii
java programming basics - part ii
 
Variable
VariableVariable
Variable
 
#_ varible function
#_ varible function #_ varible function
#_ varible function
 
Data types - brainsmartlabs
Data types - brainsmartlabsData types - brainsmartlabs
Data types - brainsmartlabs
 
Java Input and Output
Java Input and OutputJava Input and Output
Java Input and Output
 
Data types03
Data types03Data types03
Data types03
 
Smali语法
Smali语法Smali语法
Smali语法
 
oop lecture 2
oop lecture 2oop lecture 2
oop lecture 2
 
Model Fields in Odoo 15
 Model Fields in Odoo 15 Model Fields in Odoo 15
Model Fields in Odoo 15
 

Similar to Types in .net

DATA TYPES IN C Language.pptx
DATA TYPES IN C Language.pptxDATA TYPES IN C Language.pptx
DATA TYPES IN C Language.pptxkaransethi63
 
Variables in C++, data types in c++
Variables in C++, data types in c++Variables in C++, data types in c++
Variables in C++, data types in c++Neeru Mittal
 
variablesfinal-170820055428 data type results
variablesfinal-170820055428 data type resultsvariablesfinal-170820055428 data type results
variablesfinal-170820055428 data type resultsatifmugheesv
 
Data Type is a basic classification which identifies.docx
Data Type is a basic classification which identifies.docxData Type is a basic classification which identifies.docx
Data Type is a basic classification which identifies.docxtheodorelove43763
 
datatypes-200723165518 (1).pptx
datatypes-200723165518 (1).pptxdatatypes-200723165518 (1).pptx
datatypes-200723165518 (1).pptxNaniBhai3
 
cassignmentii-170424105623.pdf
cassignmentii-170424105623.pdfcassignmentii-170424105623.pdf
cassignmentii-170424105623.pdfYRABHI
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programmingHarshita Yadav
 
CSharpCheatSheetV1.pdf
CSharpCheatSheetV1.pdfCSharpCheatSheetV1.pdf
CSharpCheatSheetV1.pdfssusera0bb35
 
basics-of-python-programming3.pptx
basics-of-python-programming3.pptxbasics-of-python-programming3.pptx
basics-of-python-programming3.pptxRohanSharma351159
 
lecture 3 bca 1 year.pptx
lecture 3 bca 1 year.pptxlecture 3 bca 1 year.pptx
lecture 3 bca 1 year.pptxclassall
 
Data Types in C language
Data Types in C languageData Types in C language
Data Types in C languageAbdulKabeer50
 
5-Lec - Datatypes.ppt
5-Lec - Datatypes.ppt5-Lec - Datatypes.ppt
5-Lec - Datatypes.pptAqeelAbbas94
 
Keywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.netKeywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.netJaya Kumari
 
C# Common Type System & Common Language Specification
C# Common Type System & Common Language Specification C# Common Type System & Common Language Specification
C# Common Type System & Common Language Specification Prem Kumar Badri
 
5variables in c#
5variables in c#5variables in c#
5variables in c#Sireesh K
 

Similar to Types in .net (20)

DATA TYPES IN C Language.pptx
DATA TYPES IN C Language.pptxDATA TYPES IN C Language.pptx
DATA TYPES IN C Language.pptx
 
Variables in C++, data types in c++
Variables in C++, data types in c++Variables in C++, data types in c++
Variables in C++, data types in c++
 
variablesfinal-170820055428 data type results
variablesfinal-170820055428 data type resultsvariablesfinal-170820055428 data type results
variablesfinal-170820055428 data type results
 
Data Type is a basic classification which identifies.docx
Data Type is a basic classification which identifies.docxData Type is a basic classification which identifies.docx
Data Type is a basic classification which identifies.docx
 
datatypes-200723165518 (1).pptx
datatypes-200723165518 (1).pptxdatatypes-200723165518 (1).pptx
datatypes-200723165518 (1).pptx
 
Introduction To C#
Introduction To C#Introduction To C#
Introduction To C#
 
Data Handling
Data HandlingData Handling
Data Handling
 
cassignmentii-170424105623.pdf
cassignmentii-170424105623.pdfcassignmentii-170424105623.pdf
cassignmentii-170424105623.pdf
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programming
 
C#
C#C#
C#
 
CSharpCheatSheetV1.pdf
CSharpCheatSheetV1.pdfCSharpCheatSheetV1.pdf
CSharpCheatSheetV1.pdf
 
basics-of-python-programming3.pptx
basics-of-python-programming3.pptxbasics-of-python-programming3.pptx
basics-of-python-programming3.pptx
 
Data Types
Data TypesData Types
Data Types
 
Type system
Type systemType system
Type system
 
lecture 3 bca 1 year.pptx
lecture 3 bca 1 year.pptxlecture 3 bca 1 year.pptx
lecture 3 bca 1 year.pptx
 
Data Types in C language
Data Types in C languageData Types in C language
Data Types in C language
 
5-Lec - Datatypes.ppt
5-Lec - Datatypes.ppt5-Lec - Datatypes.ppt
5-Lec - Datatypes.ppt
 
Keywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.netKeywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.net
 
C# Common Type System & Common Language Specification
C# Common Type System & Common Language Specification C# Common Type System & Common Language Specification
C# Common Type System & Common Language Specification
 
5variables in c#
5variables in c#5variables in c#
5variables in c#
 

Recently uploaded

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 

Recently uploaded (20)

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 

Types in .net

  • 2. Common Type System  The common type system defines how types are declared, used, and managed in the common language runtime, and is also an important part of the runtime's support for cross- language integration.  The common type system performs the following functions  Establishes a framework that helps enable cross-language integration, type safety, and high-performance code execution.  Provides a library that contains the primitive data types (such as Boolean, Byte, Char, Int32, and UInt64) used in application development.
  • 3. Value types and Reference types  C# divides the world of types into value types and reference types. Value types are created on the stack. All the intrinsic types (int ,long) are value types and thus are created on the stack.  Objects on the other hand, are reference types. Reference types are created on an undifferentiated block of memory known as the heap.  Structs, types such as int, float, long etc are value types.  Strings are reference types.  Memory of reference types is claimed by garbage collector.
  • 5. Value Types  Value type variables can be assigned a value directly. They are derived from the class System.ValueType.  The value types directly contain data. Some examples are int, char, and float, which stores numbers, alphabets, and floating point numbers, respectively. When you declare an int type, the system allocates memory to store the value.
  • 6. C# Memory Range int 4 bytes –2147483648 to 2147483647 long 8 bytes –9223372036854775808 to 9223372036854775807 byte 1 byte 0 to 255 float 4 bytes –1.5x10-45 to 3.4 x x1038 double 8 bytes –5.0x10-324 to 1.7x10308 char 2 bytes Unicode characters boolean 1 byte True or false Predefined Data Types
  • 7. Reference Types  The Reference type variable is such type of variable in C# that holds the reference of memory address instead of value. Reference Type Class Type Type name Object String Interface Type Array Delegate Type
  • 8. For example, consider following string variable: string s = "Hello World!!"; The following image shows how the system allocates the memory for the above string variable. Memory allocation for Reference typeAs you can see in the above image, the system selects a random location in memory (0x803200) for the variable 's'. The value of a variable s is 0x600000 which is the memory address of the actual data value. Thus, reference type stores the address of the location where the actual value is stored instead of value itself.
  • 9. References  http://www.tutorialspoint.com  http://www.tutorialsteacher.com  https://www.youtube.com/watch?v=NbucRONDb78 Thank You