If you define integer variable and a object variable and a structure then how those will be plotted in memory ?



If you define integer variable and a object variable and a structure then how those will be plotted ..

Answer / 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

More C Sharp Interview Questions

What is the components of window?

0 Answers  


Which are the loop types available in c#?

0 Answers  


What is difference between the "throw" and "throw ex" in .net?

0 Answers  


Can you override private virtual methods?

5 Answers  


What is foreach loop in c#?

0 Answers  






What is command object in c#?

0 Answers  


Is stringbuilder thread safe c#?

0 Answers  


What are the differences between events and delegates in c#?

0 Answers  


What is covariance and contravariance? Did Delegate and method overriding support these?

1 Answers   TCS,


How to Show Message box in Metro Style App?

0 Answers   PUCIT,


Which is faster dictionary or list?

0 Answers  


What is dataadapter c#?

0 Answers  


Categories