Understanding Common Type System in .NET
page 3 of 6
by Suresh Kumar Goudampally
Feedback
Average Rating: 
Views (Total / Last 10 Days): 36498/ 148

Value Types and Reference Types

Value Type

A variable of this type represents a piece of data itself. Memory is allocated on the stack.

Listing 1

// Structure , Enumerations and primitive datatypes.
int i = 8;
int i1 = i;
i = 9;

Here, changing one will not have impact on another; the memory here is created twice.

Reference Type

A variable of this category points to the location of data rather than data itself. Memory is created on the heap. Arrays, Classes, Delegates and Interface are examples.

This type is similar to pointers.

Listing 2

Class1 objClass1 = new Class2();
objClass1.Name = "S";
Class1 objClass1Intance = objClass1;
objClass1Intance = "SU";      

Here, both instances refer to the same object, changes to one applies to both.


View Entire Article

User Comments

Title: hey   
Name: hey
Date: 2012-08-08 6:54:00 AM
Comment:
xyz
Title: kuk   
Name: iuyi
Date: 2012-08-08 6:53:37 AM
Comment:
ki8ui8k
Title: book   
Name: lalli
Date: 2012-04-14 11:26:11 AM
Comment:
r
Title: CTS/CLS   
Name: Sonali Joshi
Date: 2010-03-30 12:12:24 AM
Comment:
A really nice articla. it helps me to understand the difference between CLS/CTS also how the concepts works.
Thanks a lot :)
Title: CTS   
Name: Surendra singh
Date: 2009-04-14 6:05:41 AM
Comment:
This helps me to understand CTS in a easy way.It's realy a very helpful to understand.
thanks
Title: CTS   
Name: SHOBANA
Date: 2009-03-25 7:20:50 AM
Comment:
This article is Really helped to me for understand cts. Thank u very much..,
Title: cts   
Name: Deepak
Date: 2009-03-06 1:14:28 AM
Comment:
u have helped me to understand cts.Thnks
Title: COMMON LANGUAGE SPECIFICATION   
Name: JAYSHREE DONGA
Date: 2009-02-10 5:45:58 AM
Comment:
THIS ARTICLE IS REALLY VERY NICE
Title: comman language specification   
Name: mira
Date: 2008-12-27 1:21:58 AM
Comment:
there is very few discription about the CLS
Title: Hi   
Name: Sunny
Date: 2008-05-31 3:44:39 AM
Comment:
Superb, great work.........
Title: Good Notes   
Name: Babitha
Date: 2008-03-07 11:53:18 AM
Comment:
Very Nice.
Title: Hi   
Name: Suresh Kumar
Date: 2008-01-31 7:05:12 AM
Comment:
Hi shivaprasad,
can i know and who r u and

for which company you are working for?


Regards
Suresh Kumar Goudampally
Title: Good notes   
Name: s.k.shivaprasad
Date: 2008-01-31 4:32:59 AM
Comment:
Good work! I would like to see more articles from you in the future



thanks,
s.k.shivaprasad
Software Engineer.
Title: Understanding CTS   
Name: Madhavi G
Date: 2008-01-30 12:04:55 AM
Comment:
Good One, though i am from testing, was able to understand, keep posting such articles.
Title: CTS   
Name: Nitin Sharma
Date: 2008-01-11 2:01:57 AM
Comment:
Good One..!! :-)

Nitin Sharma
Software Engineer
Title: Good Article   
Name: Joydip Kanjilal
Date: 2008-01-10 11:50:31 AM
Comment:
Good work! I would like to see more articles from you in the future.

Thanks,

Joydip

Author: ASP.NET Data Presentation Controls Essentials (Packt Publishing)






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2019 ASPAlliance.com  |  Page Processed at 2019-05-26 5:32:53 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search