I understand why the Parent's get1 method gets called on both instances i.e. because static methods are not overridden. What i don't understand is why the output is different if i override the get() method as shown below:
With the overridden get() method, the output is
Why does the version with the overridden get() method not call the Parent's get1() method for the object using the Parent reference (i.e. Parent p = new Child())?
if you call this method on a reference which points to his sub class object then it the method is static it process the reference's method else sub class's method. and in your second case get method of sub class called[because get() is an instance method] and then it execute its own static get method[this.get1()]