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
Can you create an instance of a static class?
When should we use delegates in c#?
Explain the concepts of cts and cls(common language specification).
How can you sort strings in array that are passed to method as arguments?
How we can create an array with non-default values?
What is int32 maxvalue?
What is the task perform by clr?
What is action in c# 3.5?
What is an expression in c#?
What is web forms in c#?
What is a dynamic assembly?
What is the difference between func and action delegate?
Is c# pass by reference?
How to install or uninstall a windows service?
Explain the different types of delegates used in c#.