If we inherit a class do the private variables also get
inherited ?

Answer Posted / kishore.a

Private variables are not inherited. Access specifier
Private is mainly mean for the inheritance concept so that
derived classes cannot inherit the private members of base
class..

Is This Answer Correct ?    3 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is writeline?

685


In which order the constructor is called for an inherited class?

747


Differentiate between method overriding from method overloading with its functionality?

756


What is the difference between writeline and write in c#?

652


What do constructors do in c#?

694


What are extensions in c#?

748


Why do we use Design Pattern in C#?

824


Can a constructor be static in c#?

774


How is method overriding different from overloading?

786


How do you define a predicate?

679


What is the difference between System.console.WriteLine() and System.console.Write() function?example?

839


In c#, what will happen if you do not explicitly provide a constructor for a class?

760


Can we maintain state in webservice?

770


How can I develop an application that automatically updates itself from the web?

701


what is c# command?

741