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


Please Help Members By Posting Answers For Below Questions

What does break do in loop?

492


If I have more than one version of one assemblies, then how'll I use old version (how/where to specify version number?)in my application?

526


Can you create an instance of a static class?

554


Helo , Help Me , Help Me About : C# Windows Application - Network How To Manage IP Client's Accessiblity To The Internet Share concise Substitute , Minor ISA Server

1459


What is the default value of decimal in c#?

494






Explain the difference between and xml documentation tag?

498


Can I fly with a loop recorder?

479


How many types of inheritance are there in c#?

478


What is the difference between as and is operators in c#?

440


Can I use ReaderWriterLock instead of Monitor.Enter/Exit for Threading?

515


How does return work in c#?

506


Explain the difference between proc. Sent by val and by sub?

477


Define MSIL, and how does it works? Why our developers need an appreciation of it if at all?

508


What is the xml document structure?

476


What is the purpose of namespace in c#?

446