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
How to assign Null value to Var?
Explain the difference between private and shared assembly?
Why does my windows application pop up a console window every time I run it?
How is a loop recorder monitored?
Explain the difference between and xml documentation tag?
Can I call a virtual method from a constructor/destructor?
Define collections?
Can abstract class have constructor c#?
What is the c# equivalent of c++ catch (...), Which was a catch-all statement for any possible exception?
Explain the 3 types of properties in c# with an example?
What is a string in c#?
What is the full form of GAC? Explain its uses?
What is ControlBox Propertie
What are types of constructor?
Are c# references the same as c++ references?