At the time if class loading i and j both will be initialized by 0. After that assignment is done, thus 0 is returned by the method and assigned to i and 10 is assigned to j.
null can be assigned in a reference of String type. so string version will be called since String is subclass ob Object. If string version is not written in this program, then in that case its superclass i.e. Object version will be called.