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 the use of ispostback in c#?

1 Answers  


Is array ienumerable c#?

1 Answers  


Which is faster list or dictionary in c#?

1 Answers  


What is dataset c#?

1 Answers  


Which type of variables are under the control of garbage collector?

4 Answers   Kanbay,


Does c# support #define for defining global constants?

1 Answers  


Can you explicitly call a destructor?

1 Answers  


Describe ways of cleaning up objects.

8 Answers   Wipro,


Difference between string and stringbuilder?

3 Answers   HCL, Siemens, TCS,


Can we create instance of private class in c#?

1 Answers  


What's the difference between a method and a procedure?

1 Answers  


Can a class be protected in c#?

1 Answers  


Categories