Overriding return type

Asked 2 years ago, Updated 2 years ago, 27 views

Even if method override return type is specified as an inheritance relation object type, There is no error on the compilation, is it okay?

java

2022-09-22 12:01

1 Answers

It's a self-answer http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.4.5

It supports specialization in upper-lower relationships


2022-09-22 12:01

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.