Are private class-level variables inherited?

Answers were Sorted based on User's Feedback



Are private class-level variables inherited?..

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

Are private class-level variables inherited?..

Answer / suresh.gv

Yes Private Variables are inherited to the Derived Class.

But we can't access them on Derived Class

Is This Answer Correct ?    9 Yes 1 No

Are private class-level variables inherited?..

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

Are private class-level variables inherited?..

Answer / kiran

private and protected members are inherited

Is This Answer Correct ?    4 Yes 2 No

Are private class-level variables inherited?..

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

Post New Answer

More C Sharp Interview Questions

Which is faster iqueryable or ienumerable?

0 Answers  


If casting fails what type of exception is thrown?

0 Answers  


Explain static class members.

0 Answers  


What are the commonly used i/o classes?

0 Answers  


What is the namespace for datatable in c#?

0 Answers  






Where test director stores its data ? Database ,Local file etc...? I need to read this data from Visual Studio 2005 c# client. Regards

0 Answers  


Tell me something about Exceptions. What is the common exception class?

4 Answers   HCL,


How can you write a class to restrict that only one object of this class can be created (Singleton class)?

0 Answers  


What is an icollection in c#?

0 Answers  


Can constructor be protected?

0 Answers  


What is the function of the not null constraint?

0 Answers  


What are the differences between a class and a struct?

0 Answers  


Categories