-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
1.2.0
-
generic
-
generic
Name: gb36485 Date: 11/18/98
The Java virtual machine, for reasons of binary compatibility, already
allows a method to be overridden by a method of the same signature
but with a return type which is a subtype of the method it overrides.
For greater type safety, the Java language should remove the restriction
that overriding methods must have the same return type as the methods
they override.
I will submit a more detailed proposal, including changes to the JLS, in
the future.
Note that this is a 100% compatible change.
(Review ID: 42168)
======================================================================
The Java virtual machine, for reasons of binary compatibility, already
allows a method to be overridden by a method of the same signature
but with a return type which is a subtype of the method it overrides.
For greater type safety, the Java language should remove the restriction
that overriding methods must have the same return type as the methods
they override.
I will submit a more detailed proposal, including changes to the JLS, in
the future.
Note that this is a 100% compatible change.
(Review ID: 42168)
======================================================================
- duplicates
-
JDK-4144488 Allow covariant return types
- Resolved