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 hashtable in c# net with example?
How many kinds of elements an array can have?
What is xaml in c#?
If a.equals(b) is true then a.gethashcode & b.gethashcode must always return same hash code.
What is difference between dictionary and hashtable in c#?
What is difference between private, protected, and public in C#?
Can a static class contain non static members?
What are value types and reference types?
What are instance fields in c#?
Can I fly with a loop recorder?
What is the difference between virtual and override in c#?
In a memory when you Box and Unbox a value-type what happens?
What are the Types of optimization and name a few and how do u do?
How many digits are in an integer?
What are the 2 broad classifications of data types available in c#?