IT Community - Software Programming, Web Development and Technical Support

What is Value type and reference type in .Net?

This is a discussion on What is Value type and reference type in .Net? within the VB.NET Programming forums, part of the Software Development category; What is Value type and reference type in .Net?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > VB.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-26-2007, 12:31 AM
anbuchezhians anbuchezhians is offline
D-Web Programmer
 
Join Date: Jul 2007
Posts: 77
anbuchezhians is on a distinguished road
Question What is Value type and reference type in .Net?

What is Value type and reference type in .Net?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-27-2007, 09:01 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Re: What is Value type and reference type in .Net?

(From MSDN)
Value types include:
All numeric data types
Boolean, Char, and Date
All structures, even if their members are reference types
Enumerations, since their underlying type is always Byte, Short, Integer, or Long

Reference types include:
String
All arrays, even if their elements are value types
Class types, such as Form
Delegates
Got It...

Oxygen
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-21-2007, 10:42 PM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Wink Re: What is Value type and reference type in .Net?

Value types directly contain their data which are either allocated on the stack or allocated in-line in a structure.

Reference types store a reference to the value's memory address, and are allocated on the heap. Reference types can be self-describing types, pointer types, or interface types.

Variables that are value types each have their own copy of the data, and therefore operations on one variable do not affect other variables. Variables that are reference types can refer to the same object; therefore, operations on one variable can affect the same object referred to by another variable. All types derive from the System.Object base type.
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get element by its type seesamjagan HTML, CSS and Javascript Coding Techniques 3 01-02-2008 04:51 AM
Can I set the MIME type with a <meta/> tag itbarota HTML, CSS and Javascript Coding Techniques 1 09-11-2007 12:39 AM
How to do a type conversion in VC++ .NET? bluesky C and C++ Programming 2 08-10-2007 05:38 AM
void return type anbuchezhians Java Programming 1 07-25-2007 05:55 AM
C # Support C type macros~! vigneshgets C# Programming 0 05-17-2007 07:19 AM


All times are GMT -7. The time now is 02:56 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0