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
Can an exception be thrown from a catch block?
Is it possible to have different access modifiers on the get/set methods of a property in c#?
Are c# strings null terminated?
What do you mean by a windows process in regards to memory allocation?
Explain publishers and subscribers in events.
What does readonly mean in c#?
What is parsing?
What is a cshtml file?
What is a byte in c#?
What is uint16?
What is the difference between string and string in c#?
What is function and method in c#?
Enlist some of the properties of a thread class?
What is generic types in c#?
What is the difference between gettype and typeof in c#?