-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
  • 42,928
  • 5
  • 50
  • 93

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,173
  • 5
  • 46
  • 60