Are private class-level variables inherited?
Answers were Sorted based on User's Feedback
Answer / venu gopal
Yes, but they are not accessible, so looking at it you can
honestly say that they are not inherited. But they are.
| Is This Answer Correct ? | 18 Yes | 0 No |
Answer / duc nguyen
according to "http://www.velocityreviews.com/forums/t130343-question-about-inheritance-of-private-variables.html"
"According to the Java Language Specification, the definition of "inherited"
is such that the data member is available by subclasses. Using this
definition, private members are not inherited, HOWEVER, they are 'there',
that is, instances of the subclass contains the data that is held by the
private member - it is just not exposed by the superclass"
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / kirti
Yes, but they are not accessible. Although they are not visible or accessible via the class interface, they are inherited.
| Is This Answer Correct ? | 0 Yes | 0 No |
Using system; class main { public static void Main() { int a = 1; for (int i = 0; i < 10; i++) { int j = a * 5; Console.WriteLine(a + "*5=" + j); a++; } Console.ReadLine(); } }
What are the two uses of a ‘using’ statement in c#?
How many digits are in an integer?
What is the difference between CONST and READONLY?
What is difference between abstract class and interface in c#?
Is c# dictionary a hash table?
What?s the advantage of using System.Text.StringBuilder over System.String?
Is null empty or whitespace c#?
What is the property of class?
Constructor to an arbitrary base constructor?
What does firstordefault mean in c#?
What is the purpose of constructor in c#?
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)