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 serialization in dot net?

475


Write a program in c# to find the angle between the hours and minutes in a clock?

479


What is interpolation in programming?

482


what is the scope of anonymous type ?

576


What is an assembly qualified name

514






Explain the types of comments in c#?

541


What is Global Assembly Cache (GAC) and what is the purpose of it? (How to make an assembly to public? Steps) How more than one version of an assembly can keep in same place?

558


What do you mean by parsing and how to parse a date time string in c#?

515


How do you declare a variable in c#?

512


Is Facebook a desktop application?

462


In howmany ways can you deploy an assembly?

538


What are data types in C#?

560


What does args mean in c#?

490


What is the difference between constants and read-only?

466


Differentiate between method overriding from method overloading with its functionality?

531