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 is firstordefault c#?

754


What is difference between hashtable and dictionary in c#?

742


What is the use of GC.KeepAlive Method?

934


Explain dataadapter.update method in .net?

767


How many types of constructors are there?

709


What is int parse in c#?

732


What is c# used for?

740


What is asp net in c#?

742


Why delegate is used in c#?

704


Why do you need boxing in c#?

695


What is delegation in oops?

754


How big is an int16?

707


Define c# i/o classes?

736


What is action in c# 3.5?

780


What is the difference between console application and windows application?

771