Is there any way to access private memebers of an object
from another object?
Answer Posted / mohit jethva
You need to create a property with private field and make
property as public so you can access private field using
public property in other object.
eg.
private int _ID;
public int ID
{
get{return value;}
set{_ID = value;}
}
| Is This Answer Correct ? | 10 Yes | 1 No |
Post New Answer View All Answers
What is private readonly in c#?
What is the difference between a field and a property in c#?
Explain about c# language.
How to use delegates with events?
What is the difference between ienumerable and icollection?
Explain about ODP.net
Can a static class have a constructor c#?
Can a struct be null?
Why to use “finally” block in c#?
Explain boxing and unboxing in c#?
What is data binding c#?
Explain concurrency with aop?
Why do we need to serialize data?
Can I fly with a loop recorder?
Explain copy constructor?