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 / 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 View All Answers
Can a struct inherit from an interface in c#?
What is access modifier in c#?
What is the console on a mac?
Difference between directcast and ctype.
How long does a loop recorder procedure take?
Write the difference between TypeOf and GetType?
What does readonly mean in c#?
How to use the sreamReader class to read form a text file?
What is difference between private and protected?
What type of data type conversion happens when the compiler encounters the following code?
What are the benefits of using generics in c#?
How to get the sum of last 3 items in a list using lambda expressions?
what is a constructor? What is a destructor?
Define multicast delegate? How it be used?
What are data types in C#?