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


Please Help Members By Posting Answers For Below Questions

What is the use of oops in c#?

688


What do you mean by shared assembly?

778


How do you escape c#?

703


Can you pass parameters to destructors?

730


What is the task perform by clr?

754


Define interface class in c#?

681


What is an array of arrays called?

615


What does do in c#?

714


Can hashset contain duplicates c#?

661


Who introduced c#?

662


What is asynchronous one-way calls?

736


What is ac callback?

670


Does hashset allow duplicates c#?

709


What happens if you add duplicate elements to a set?

683


Is c# a keyword?

690