In Java, is it possible to override methods if return types are respectively a primitive and its wrapper class?
问题 While working with the idea of overriding and overridden methods in Java I have noticed that there is some flexiblity given for the return types of such methods. Here is a bit of theory: "The return type of an overriding method in the derived class can be the same, or a subclass of the return type of the overridden method in the base class. The return type of such an overriding method is known as a covariant return type." Example below supposes that B extends A. Method in A: public Object