class X1 { private final void show() { ... } } class X2 extends X1 { private final void show() { ... } } Question 1
The code is compiling without any errors. Since the final keyword prevents methods from being overidden, why does the code compile?
Question 2
If I remove the private keyword from both show methods, the code doesn't compile as expected. Why?