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

Why c# is type safe?

0 Answers  


What are the principles of delegation?

0 Answers  


How many types of collections are there in c#?

0 Answers  


Why we put script in head of asp.net page Why not in body?

1 Answers  


How does inheritance work in c#?

0 Answers  


write a c# program add two matrix with input number ?

0 Answers   Wipro,


What is a long in c#?

0 Answers  


How do you declare an arraylist?

0 Answers  


What is primitive types in c#?

0 Answers  


Are classes passed by reference in c#?

0 Answers  


Why do we use anonymous method in c#?

0 Answers  


What is Implementation inheritance

0 Answers  


Categories