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

Answers were Sorted based on User's Feedback



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

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

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

Answer / satya

in Dotnet dn=new Dotnet(); here Dotnet dn creates a
reference variable(LHS) and new Dotnet(); creates an object.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Sharp Interview Questions

How will you get the different language strings?

0 Answers  


How can you sort the elements of the array in descending order?

1 Answers   Junosource, Siebel Systems, Wipro,


What do you mean by synchronous and asynchronous operations?

0 Answers  


What is the difference between int.Parse() and Convert.toInt32().

2 Answers  


Which of the following API is used to hide a window?

0 Answers   3i Infotech,






What is difference between struct and class in c#?

0 Answers  


What does Dispose method do with the connection object?

2 Answers  


What is an escape sequence in c#?

0 Answers  


How do you declare a variable in c#?

0 Answers  


Are tuples immutable c#?

0 Answers  


What are classes in c#?

0 Answers  


what is read only and constant

8 Answers   FIC, IBM,


Categories