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 are Indexers in C#?

0 Answers   SwanSoft Technologies,


What are the steps to create a webservice and consume it?

0 Answers  


What is file extension of webservices?

0 Answers  


2. What happened when BO object has been called?

0 Answers   Mphasis,


Write a program in c# to find the angle between the hours and minutes in a clock?

0 Answers  






Define mutex in C#?

0 Answers  


Name the control which cannot be placed in mdi?

0 Answers  


What is the difference between int.Parse() and Convert.toInt32().

2 Answers  


Define assert() method? How does it work?

0 Answers   Siebel,


Why do we Need of static class in c#?

0 Answers   NA,


What is the use of static in c#?

0 Answers  


What is static void main in c#?

0 Answers  


Categories