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...

Answers were Sorted based on User's Feedback



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

Answer / bakku pavan kumar

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 ?    20 Yes 0 No

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

Answer / satya

in Dotnet dn=new Dotnet(); here Dotnet dn creates a
reference variable(LHS) and new Dotnet(); creates an object.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Sharp Interview Questions

How to open a new form on button click in Windows forms?

0 Answers   Viscus Infotech,


What is difference between a constant and read-only in C#?

0 Answers   CDC,


How can you overload a method?

6 Answers  


Explain use of abstract and sealed classes in c#?

0 Answers  


What is the relation between classes and objects?

0 Answers  






What is serializable in c#?

0 Answers  


How can you reference current thread of the method ?

0 Answers  


Is dll a library?

0 Answers  


what is the real use of interface in c#,other than that multiple inheritance is not possible

7 Answers  


Can you override private virtual methods?

4 Answers  


what is used ref keyword in c#,and how we used it?

2 Answers  


How do I enforce const correctness in c#?

0 Answers  


Categories