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

Answer Posted / ashwini chavan

yes they are inherited, but cannot be accessible.because
when we inherite the class then all data member and function
member of the base class are accesed in the derive class
attomaticaly.but private specifier is accesible only it's
own class out side class can't acces that private member
when we try it then we got error

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can non-default constructors be used with single call sao?

517


What does void do in c#?

508


What is Fragmentation and its Types?

558


What are the 2 kinds of data type conversions in c#?

508


Explain the difference between const and static read-only?

501






Does c# support multilevel inheritance?

481


How do I format a string in c#?

476


Is c# and c same?

505


What does void mean in c#?

506


What is static noise?

501


What is ienumerable and iqueryable?

499


What is different about switch statements in c#?

484


Name any three ways to pass parameters to a method in c#?

483


Can hashset contain duplicates c#?

461


If a child class instance is created, which class constructor is called first - base class or child class?

501