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
How many dimensions can an array have?
What is c# in asp net?
How does the clr work?
What are object pooling and connection pooling and difference between them?
what will be the output of the given below coding. using System; public class Exercise { static void OddNumbers(int a) { if (a >= 1) { Console.Write("{0}, ", a); a -= 2; OddNumbers(a); } } public static int Main() { const int Number = 9; Console.WriteLine("Odd Numbers"); OddNumbers(Number); Console.WriteLine(); return 0; } }
What is an inheritance ?Give an example in which inheritance is used?
What does int32 mean?
How do you clear a list in c#?
What is extension method in c# and how to use them?
Explain about finalize method?
What are the advantages of using partial classes?
What's the difference between abstraction and encapsulation?
What is the data type for bit in c#?
What is datagrid c#?
Is c# difficult to learn?