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 we extend static class in c#?
What is the meaning of 0 in c#?
What is the difference between “finalize” and “finally” methods in c#?
What is the difference between dynamic and var in c#?
What is an example of a delegate?
What Is A Multicast Delegate?
Why References are stored on heap and variables on stack?
Is array reference type in c#?
What are console applications used for?
Explain types of comment in c# with examples
What is the difference between serialization and deserialization in c#?
What is parameter c#?
Why do you call it a process? What’s different between process and application in .net, not common computer usage, terminology?
Why are mutable structs evil?
What is an assembly in .net?