If you define integer variable and a object variable and a structure then how those will be plotted in memory ?
Answer Posted / mr vinod kumar
Integer , structure – System.ValueType -- Allocated memory on stack , infact integer is primitive type recognized and allocated memory by compiler itself .
Infact , System.Int32 definition is as follows :
[C#]
[Serializable]
public struct Int32 : IComparable, IFormattable, IConvertible
So , it’s a struct by definition , which is the same case with various other value types .
Object – Base class , that is by default reference type , so at runtime JIT compiler allocates memory on the “Heap” Data structure .
Reference types are defined as class , derived directly or indirectly by System.ReferenceType
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is a interface in c#?
What is multiple interface in c#?
What is a virtual property. Give an example?
Is c# slower than java?
What is difference between ienumerable and iqueryable in c#?
What is delegates in c# and uses of delegates?
What is the difference between method and function in c#?
What are the benefits of using windows services:
What is the use of readkey in c#?
How does c# generics and c++ templates compare?
In a site to turn off cookies for one page which method is followed?
What is a static field?
Is stringbuilder better than string?
Explain the process of polymorphism with an example?
How do I enforce const correctness in c#?