Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Is there any way to access private memebers of an object
from another object?

Answer Posted / rajesh

In C++ we can access private members of one class by the
object of another class,befor that we have to
make "friend"(keyword) the respective member of the first
class to the second class
for ex:
class A
{
private void display();
};

inherits: class B
{
friend void display();
};
Now we can acess the 'display' function using classB
object.We can only make friend to the immediate inherited
class and not to all classes under inheritance.

and in C# we have to create a property as first answer

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a delegate? Explain.

994


What is stringbuilder c#?

1018


What is extension method in c sharp?

950


Is array a list?

940


What are the types of access modifiers?

961


Give examples for value types?

1004


Can we instantiate abstract class in c#?

952


What is sealed class in c#?

958


Where is c# compiler located?

967


Explane each and every methods of nterface Queue? Explain About performance issues on retrieving records

1120


Explain the types of errors in c#?

958


Describe the types of comments in c#?

964


How Reflection is used and what it's significance ?

989


What is the difference between an implicit conversion and an explicit conversion?

1046


How to use nullable types in .net?

1053