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


Please Help Members By Posting Answers For Below Questions

Can you create an instance of a static class?

744


When should we use delegates in c#?

671


Explain the concepts of cts and cls(common language specification).

723


How can you sort strings in array that are passed to method as arguments?

717


How we can create an array with non-default values?

706


What is int32 maxvalue?

714


What is the task perform by clr?

747


What is action in c# 3.5?

740


What is an expression in c#?

672


What is web forms in c#?

677


What is a dynamic assembly?

725


What is the difference between func and action delegate?

685


Is c# pass by reference?

684


How to install or uninstall a windows service?

765


Explain the different types of delegates used in c#.

705