-2

When we inherit a class which is having the private members in Java, are the private members also inherited? If yes, why cant get them by the class object? If no, then why?

ernest_k
  • 44,416
  • 5
  • 53
  • 99

1 Answers1

0

The definition of private means that they cannot be accessed directly in a sub-class. Have a look at Java's access control.

dave
  • 11,641
  • 5
  • 47
  • 65