Salim
1. The printS1S2 method is declared only in the super-class R, so that method will be called whether the run-time type of the object is of class R or S.
2. printS1S2 calls a private method in R, printS1. Private methods are essentially final, and cannot be overridden or hidden. That means that regardless of whether the run-time type of the object is of class S or class R, printS1S2 will call printS1 in R.
3. printS2 is not private, and is overridden in S. If the run-time type of the object is S, S.printS2 is called, and if the run-time type of the object is R, R.printS2 is called. This is an example of overriding and
polymorphism.
output:
R:R.printS1 R.printS2
R(S):R.printS1 S.printS2
S:R.printS1 S.printS2