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
In how many ways you can overload a method?
What do you mean by abstract class in c#?
What is a property c#?
What is Reflection in .NET? Namespace? How will you load an assembly which is not referenced by current assembly?
How do I create a .exe file?
What can you do as a .net developer?
Is unity object oriented?
What is difference between ienumerable and list?
Can I define my own exceptions?
What is single dimensional array in c#?
What are the types of constructors?
What is the difference between new and override in c#?
Why do we need interface in c#?
What is difference between const and static in c#?
what is difference between destruct or and garbage collection ?