suppose we have two object;obj1 and obj2
can we assign obj2 to one1;
and if yes; then after assigning suppose we delete obj2
then obj1 will retain obj2 value or not.
Answer Posted / mahesh kotekar
Very tricky question, perhaps i would like to answer this
one with small coding.
Employee e1 = new Employee('mahesh','Software');
Employee e2 = e1;
e1 = null;
console.writeline(e2.FirstName);
Answer: We can assign the reference of the object to other
object. since both e1 and e2 refers to the same memory
location for the empllyee object. If we change the e1 then
refernce to memory of e1 will get deleted but e2 stil refers
to the same memory location Certainly it will work. and
retain the value.
Thanks And Regards
Mahesh KOtekar
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
What is the used of "ispostback" property?
How to display Alert in ASP.NET
What is content page in asp net?
Differentiate between Server.Transfer and Response.Redirect with functionality? Why we can choose one over the other?
How to disable cut, copy and paste in TextBox using jQuery in asp.net?
What is a page life cycle? What are the events in a page life cycle?
Explain how does asp page work?
Explain what does wsdl stand for?
What is runat?
Contrast oop and soa. What are tenets of each16. How does the xmlserializer work? What acl permissions does a process using it require?
What is caching? What are different ways of caching in asp.net?
Tell me how asp.net mvc differs from asp.net web forms? : asp.net mvc
Why we use content place holder in asp.net?
Can you explain autopostback?
Explain server-side scripting and client-side scripting.