Here\'s an interesting code snippet:
public class Superclass {
public static void main (String[] args){
Superclass obj = new Subclass();
Superclass obj = new Subclass();
At this point, obj is both things, a Subclass, and a Superclass object. The fact that you use Superclass in the declaration of the variable is just a matter of casting it.
When you do: obj.doSomething(), you are telling the compiler to call the private method doSomething() of obj. Because you are doing it from the main static method inside Superclass, the compiler can call it.
If you would use the main method of Subclass rather than the one in Superclass, you would not be able to access that method because, as you said, it's neither inherited nor a part of your definition of Subclass.
So basically you understood inheritance correctly. The problem was related to the visibility of private methods.