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
Why are c# strings immutable?
What can be done with c#?
What is difference between events and delegates?
What is a decimal in c#?
How do I link two windows forms in c#?
What is the diff between the System.Array.CopyTo() and System.Array.Clone()?
How do I create a dbml file?
What is linq c#?
What does f mean in c#?
What is the default scope of a class in c#?
What does char mean in c#?
What is before string in c#?
What are the Types of JIT and what is econo-JIT
Explain About Virtual functions and their use.
Is c and c# the same?