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 are the major built-in objects in ASP.NET?
Which Is Faster MVC or ASP.net ?
Can you change a Master Page dynamically at runtime?
What's the use of response.output.write()?
What do you understand by aggregate dependency?
Any one can tell how we store tiff format images in database and retrive from the database(need for tiff format only)
What is the asp.net mvc folder conventions? : asp.net mvc
How does session authentication work?
Explain the differences between clr & cts?
What is rich control in asp.net?
Explain Authentication mechanism in dotnet
Write a code snippet to implement the indentation in json in web api.
Why is global asax is used for?
What is the difference between session and viewstate in asp.net?
What is the significance of attaching a profile while creating a user?