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
From a versioning perspective, what are the drawbacks of extending an interface as opposed to extending a class?
What is the default value of boolean variable?
How do I create a multilanguage, single-file assembly?
What is console write in c#?
What is thread life cycle in c#?
can you declare an override method to be static if the original method is not static?
What are the two kinds of properties in c#.
What is an int c#?
How is a strongly-named assembly different from one that isn’t strongly-named?
What is the name of c# compiler?
What is a sealed class?
Suppose you have already existing application with Visual Studio 6 (VB 6, InterDev 6) and this application utilizes Windows 2000 COM+ transaction services. With this example how can you approach migrating this application to .NET?
Difference between abstract classes and interfaces
Why do we use yield in c#?
Can you declare a class or a struct as constant?