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...

When you inherit a protected class-level variable, who is it
available to?

Answer Posted / kiran

//When you inherit a protected class-level variable, who is
it available to?
//Answer is classes within the same namespace
namespace SameNamespace
{
class MyBaseClass
{
protected int myprotectedint;

}
class MyDerivedClass:MyBaseClass
{
public int GetProtectedMember()
{
return myprotectedint;
}
public MyDerivedClass(int myvalue)
{
myprotectedint = myvalue;
}

}

class MyTest
{
public static void Main()
{
MyDerivedClass mdc = new MyDerivedClass(12);

Console.WriteLine(mdc.GetProtectedMember());
Console.ReadKey();
}
}
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are immutable types in c#?

877


What is difference between dll and exe in c#?

960


What are the types of constructors?

897


Whats an assembly? Describe the importance of assembly?

891


windows c# using datagridview in edit form sql server

4072


What is the use of parse in c#?

884


Is an interface a type c#?

945


Where are value types stored in c#?

1023


Can delegates be used as callbacks?

893


Why do we need abstraction in c#?

916


Can a static class contain non static members?

976


What is the use of iqueryable in c#?

875


Explain the use of Mutex in C#?

1001


What is the adv of using System.Text.StringBuilder over System.String?

954


In C#, explain the difference between overloading and overriding.

1106