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 advantage of constructor?

0 Answers  


What are Regex / regular expressions ?

0 Answers   QuestPond,


What is the usage of transponders?

0 Answers   Wipro,


What is default access modifier for class in c#?

0 Answers  


What is Covariance and contravariance in C#?

0 Answers   HCL,






Can you create enumerated data types in C# ?

1 Answers  


What is hashset c#?

0 Answers  


Is there regular expression (regex) support available to c# developers?

0 Answers  


Why abstract class is not instantiated in c#?

0 Answers  


How?s method overriding different from overloading?

3 Answers  


What is difference between private and protected in c#?

0 Answers  


What is a hashset c#?

0 Answers  


Categories