An instance method m_C declared in class C overrides another instance method m_A declared in class A iff either m_C is the same as m_A, or all of the following are true:
-
C is a subclass of A.
-
m_Chas the same name and descriptor asm_A. -
m_Cis not markedACC_PRIVATE. -
One of the following is true:
m_Ais markedACC_PUBLIC; or is markedACC_PROTECTED; or is marked neitherACC_PUBLICnorACC_PROTECTEDnorACC_PRIVATEand A belongs to the same run-time package as C.m_Coverrides a methodm'(m'distinct fromm_Candm_A) such thatm'overridesm_A.