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 are static and dynamic variables?
Write a short note on interface?
Why do we override in c#?
What is the .net datatype that allows the retrieval of data by a unique key?
Which sorting algorithm is best?
What is difference between overloading and short circuiting?
how can one use hcl and c sharp together?
What is a protected class in c#?
What do you mean by string objects are immutable?
What are bitwise logical operators?
Are c# strings null terminated?
Explain the process of inheriting a class into another class?
What are the types in c#?
Is string passed by reference in c#?
What is the difference between ienumerable and icollection?