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 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 |
What is difference between array and arraylist in c#?
What is difference between list and ilist in c#?
hi all.... i need code snippets for store and retrive tiff fromat images in sqlserver....... kindy provide it.......
what is main function of alternate teamplate of datalist?
What is a nested type. Give an example?
3. Describe the process of interact UI to BAL n DAL?
Explain About multi level and multiple inheritance how to achieve in .net
What is the delegates in c#?
What is lazy t?
Can you use all access modifiers for all types?
What is Asynchronous call and how it can be implemented using delegates?
From which base class do all Web Forms inherit from?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)