Here\'s an interesting code snippet:
public class Superclass {
public static void main (String[] args){
Superclass obj = new Subclass();
Since the reference type of the object obj is SuperClass, a call to doSomething() tries to access the private method defined in SuperClass itself (private methods cannot be overridden).
As doSomething() is accessible within SuperClass, the main method can call doSomething() without giving any error/s.
Hope this helps! :-)