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

Is namespace a class?

0 Answers  


What is the purpose of a console table?

0 Answers  


Define thread?

0 Answers  


Why do we use overloading in c#?

0 Answers  


Why do we use dataset in c#?

0 Answers  






Can bool be null c#?

0 Answers  


How will you deploy the dll file in gac?

0 Answers  


Can you access a hidden base class method in the derived class?

0 Answers  


What is the use of system.environment class in c#.net?

0 Answers  


Define assert() method? How does it work?

0 Answers   Siebel,


What is CLR and its application.?

0 Answers   MCN Solutions,


What is the difference between list and array in c#?

0 Answers  


Categories