You can only return a sub-class of the parent's return type.
The compile lets you auto-box and unbox between primitives and wrappers but this doesn't make one a sub-class of the other. Primitives are not classes and cannot be used in the way you suggest.
I would just have the getStatus() return Boolean
or make the parent return boolean
In theory, auto-boxing could be extended to allow what you suggest, but I don't imagine much use for it.
In theory you could also write this
class A {
int method() { ... }
}
class B extends A {
short method() { .... }
}
As the compiler supports implicit upcasting. However again, I suspect there is not much use for this either.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…