FOR EXAMPLE : CLASS Dotnet { }
creating object: Dotnet dn=new Dotnet();
NOW THE QUESTION IS WHICH IS CALLED AS OBJECT ?EITHER dn OR
new Dotnet() and CAN YOU PROVE YOUR ANSWER?????PLEASE REPLY...



FOR EXAMPLE : CLASS Dotnet { } creating object: Dotnet dn=new Dotnet(); NOW THE QUESTION IS WHICH ..

Answer / pavan7

new Dotnet(); is the object,and dn is the reference to that
object.Because,
i)
you know that REFERENCE TYPES are stored in MANAGED HEAP SO
new Dotnet(); is stored in MANAGED HEAP BUT dn is stored on
STACK MEMORY AREA.
ii)
AND,until and unless we use new keyword there is no any memory
allocation.so anything that associated with new keyword is
called as an OBJECT

WHAT WILL YOU SAY???????????
PLEASE COMMENT...........

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Sharp Interview Questions

What is executereader in c#?

0 Answers  


What is the difference between ienumerable and icollection?

0 Answers  


I have 3 overloaded constructors in my class. In order to avoid making instance of the class do I need to make all constructors to private?

0 Answers  


What is piller of OOPS in C#.

10 Answers  


What is the use of the dispose method in C# ?

0 Answers   Infosys,






What is disconnected data architecture in c#?

0 Answers  


Tell us something about static linking and dynamic linking?

0 Answers   C DAC,


What is uint64?

0 Answers  


How the versioning applies to Assemblies or can you explain version numbers?

0 Answers   CitiusTech,


How to throw an caught exception from cath block?

3 Answers   TCS,


How do I do implement a trace and assert?

0 Answers  


What are object oriented concepts?

6 Answers   Adea, Microsoft,


Categories