Welcome To Latest Dot Net Interview Questions and Answer.

In this Blog you can find all to Dot Net Interview Question and Answer. you can find Scenario based ASP.Net, VB.Net, C# and SQL Server Interview Questions and answers. Dot Net Jobs, Dot Net Books. SQL Server Books, Dot Net Based Company. Dot Net and SQL Server Training Institute.

Visual Studio.Net advanced Interview Questions, SQL Server advanced Interview Questions, Latest Interview Questions,ASP.NET, SQL Server, VB.Net, C#.Net and ADO.NET Interview Questions.Scenario Based Interview Questions. Visual Studio.Net Books and SQL Server Books. Technical Interview Questions, HR Interview Questions

In this Blog You can Find ASP.NET Web Application Projects Idea , C# Windows Application Projects Idea. VB.Net Windows Application Projects Idea, SQL Server Data Base Concept.

Value types VS Reference types C#

What is difference between Value types and Reference types in VB.NET or C# (Value types VS Reference types)

C# provides two types—class and structure, class is a reference type while the other is a value type. Here is difference between Value types and Reference types.

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. With reference types, an object is created in memory, and then handled through a separate reference—rather like a pointer.

Reference types can be self-describing types, pointer types, or interface types. Primitive types such as int, float, bool and char are value 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.

Value types have a default implied constructor that initializes the default value. Reference types default to a null reference in memory.

Value types derive from System.ValueType. Reference types derive from System.Object.

Value types cannot derive a new type from an existing value type, except for structs. Reference types can derive a new type from an existing reference type as well as being able to implement interfaces.

0 comments

Post a Comment

My Profile

I have 4 years Experience .Net and SQL Server. I am working as software engineer in private company Bangalore. I have faced many interviews. Here I am Sharing My Interview experience (Technical, HR and Written Test). This Blog is useful for .Net Developers and Freshers. My hobbies I like to play Foot ball, to read some books, to Learn new technologies. I have Experienced in Asp.Net 2.0, C#.Net, VB.Net, SQL Server and Xml.