C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
iOS
Java
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
5
Reply
Value type v/s Reference type?
Satheesh Kumar Pilli
11y
1.8k
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
Value type Stored in StackReference type stored in Heap , Destroyed by Garbage Collection
Mohamed Darwish
9y
0
The value types are the types which can be fixed in size i.e. int, float, double, short, etc. And the reference types are the types which can be variable length size i.e. string and object. the value types have default values as 0 and the reference types have default values as NULL. the Value types are converted to reference types, is known as boxing. e.g. int i = 100;object obj = i; // boxing And the value types i.e. converted into reference types are again converted back into the value type is known as un-boxing. This conversion is done by an explicit conversion as:- e.g. int j = Convert.ToInt(i); //Un-boxing
Navratna Pawale
11y
0
value type will not get destroyed by garbage collector where as reference type get destroyed by garbage collector.
Mahanti Chiranjeevi
11y
0
go to http://msdn.microsoft.com/en-us/library/4d43ts61(v=vs.90).aspx
Virendra Gaur
11y
0
Data types are classified into 2 categories First one is Value types and other one is Reference typesI) Value types: Value types stored the data on STACK(First In Last Out) which is a place where data stores in fixed length such as int, float, char etc...Note:STACK is under control of Operating System which doesn't provide automatic memory management but it is faster in access.II) Reference types: Reference types are stored on HEAP memory which is another place where data can be stored. C# supports two predefined reference types i) Object, ii)String Note: HEAP is more managed and more over it will be under the control of "Garbage Collector"
Satheesh Kumar Pilli
11y
0
What is Implicit typed variable (var) in c#?
What is Nullable values types?
Message