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...
Answer Posted / 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 |
Post New Answer View All Answers
What exactly happens when we debug and build the program?
Are cao stateful in nature?
Which property of the textbox cannot be changed at runtime?
What is multiple interface in c#?
What is the difference between c and c# programming?
What is the main usage of keyword “virtual†? How does it work for a method or property?
Is as keyword in c#?
Does a loop recorder have to be removed?
What is boxing and unboxing in c#?
Why to use “finally” block in c#?
Are private members inherited in c#?
If a child class instance is created, which class constructor is called first - base class or child class?
What is the use of expression tree in c#?
Do while loops yes or no c#?
To create a localized application which namespaces are necessary?