search
Login

Categories


C Books Guide and List
C++ Books Guide and List
Best Java Books

3.8k questions

4k answers

117 comments

10.7k users

0 votes
21 views
asked Guru 27.1k points 31 47 92

1 Answer

0 votes
A data type is a data storage format that can contain a specific type or range of values. Whenever you declare variables, each variable must be assigned a specific data type. Some common data types include integers, floating point, characters, and strings. The following are the two types of data types available in .NET:
Value type - Refers to the data type that contains the data. In other words, the exact value or the data is directly stored in this data type. It means that when you assign a value type variable to another variable, then it copies the value rather than copying the reference of that variable. When you create a value type variable, a single space in memory is allocated to store the value (stack memory). Primitive data types, such as int, float, and char are examples of value type variables.
Reference type - Refers to a data type that can access data by reference. Reference is a value or an address that accesses a particular data by address, which is stored elsewhere in memory (heap memory). You can say that reference is the physical address of data, where the data is stored in memory or in the storage device. Some built-in reference types variables in .Net are string, array, and object.
 
answered Guru 24.6k points 29 51 75

Related questions

0 votes
1 answer 17 views
17 views
asked sara Guru 24.6k points 29 51 75
0 votes
1 answer 37 views
0 votes
1 answer 84 views
0 votes
1 answer 29 views
0 votes
1 answer 16 views
16 views
asked sara Guru 24.6k points 29 51 75
...