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

Which is faster array or arraylist in c#?

688


What is 8 bit signed integer?

663


What is master page in asp net c#?

670


Explain About CLS?

745


What is data hiding in c#?

687


What is xml c#?

676


How does one compare strings in c#?

749


What do you mean by streamreader/streamwriter class in c#?

719


List the difference between interface and abstract class?

655


What is string programming language?

626


What is garbage collection? How to force garbage collector to run?

716


Can interface inherit class in c#?

726


What is the difference between iqueryable and ienumerable?

704


What is xslt in c#?

654


How do I create a multilanguage?

708