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
Which are the access modifiers available in c#?
How does split work in c#?
What is the difference between inheritance and abstract class?
What is an actual parameter?
What do you mean by a windows process in regards to memory allocation?
Howmany five tracing levels in System.Diagnostics.TraceSwitcher? Why they are using?
Can main method be final?
What is sorted list in c#?
What are circular references? How garbage collection deals with circular references.
What do you understand by an Implicit Variable?
What is Implementation inheritance and interface inheritance?
What is assembly manifest?
What is yield break in c#?
Can constructor be protected in c#?
Explain the difference between and xml documentation tag?