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...



FOR EXAMPLE : CLASS Dotnet { } creating object: Dotnet dn=new Dotnet(); NOW THE QUESTION IS WHICH ..

Answer / 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

More C Sharp Interview Questions

What is console writeline in c#?

0 Answers  


f i give input like 1,1,4,5,6,1,2,5,4,1,2, then output should be like : 1-4, 2-2, 4-2, 5-1, 6-1 which means 1 occurs 4 times, 2 occurs 2 times like so.

7 Answers  


Which is faster hashtable or dictionary?

0 Answers  


What is using keyword in C#?

0 Answers   UGC Corporation,


What is meant by desktop application?

0 Answers  






What does get set mean in c#?

0 Answers  


Can a static class contain non static members?

0 Answers  


What is console read in c#?

0 Answers  


When was c# created?

0 Answers  


What are the collection types can be used in c#?

0 Answers  


What is iqueryable in linq?

0 Answers  


Can hashset contain duplicates c#?

0 Answers  


Categories