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

Answers were Sorted based on User's Feedback



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

Answer / kirti

Derived Classes.

Is This Answer Correct ?    1 Yes 0 No

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

Answer / venu gopal

Classes in the same namespace.

Is This Answer Correct ?    1 Yes 1 No

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

Answer / 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

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

Answer / kirti

The derived class.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

What is raise event and what is its use?

1 Answers   Wipro,


Can you store multiple data types in System.Array?

7 Answers  


What is difference between managed and unmanaged code?

0 Answers   SwanSoft Technologies,


all information

1 Answers  


What operators can be used to cast from one reference type to another without the risk of throwing an exception?

0 Answers  






What does async mean in c#?

0 Answers  


What's difference between constants and static readonly?

0 Answers   Wipro,


What is the difference between Object and class adapters?

0 Answers   QuestPond,


Is c# or c++ better for games?

0 Answers  


Why do we use void in c#?

0 Answers  


Which is faster abstract class or interface in c#?

0 Answers  


What are the features of c#?

0 Answers  


Categories