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 is a Assembly?
What are the advantages of using assemble language programming?
Are attributes inherited c#?
How can I make sure my c# classes will interoperate with other .net languages?
How long does a loop recorder procedure take?
What are sessions in c#?
What is the difference between dynamic and var in c#?
Difference between type constructor and instance constructor? What is static constructor, when it will be fired? And what is its use?
What is difference between interface and abstraction?
What is an inheritance in c#?
What are the uses of namespaces?
Is it good to use var in c#?
Which namespace is required to implement trace ?
What is different between Implicit conversion and Explicit conversion in C#?
What is immutable in C#?