0 votes
in JAVA by
Can private variables be inherited?

1 Answer

0 votes
by

Can private variables be inherited?

Private variables have a class-specific scope of availability. They can only be accessed by the methods of the class in which they are present. Hence when the class is inherited, private variables are not inherited by the subclass.

Related questions

0 votes
asked May 2, 2021 in JAVA by sharadyadav1986
+1 vote
asked Dec 16, 2020 in JAVA by SakshiSharma
...