| No. | Answer | Remark | |
|---|---|---|---|
| 1 | d | Compile-time error at 3. | Both class A and B are declared in the same package, so class B has access to the public, protected, and package access methods of class A. |
| 2 | c d e | Compile-time error at 2. Compile-time error at 3. Compile-time error at 4. | Classes A and D are not declared in the same package, so class D does not have access to package access method, m4. Since class D does not extend class A, class D does not have access to the protected method, m2, of class A. |
| 3 | d e | Compile-time error at 3. Compile-time error at 4. | Class A and C are not declared in the same package; therefore, class C does not have access to package access method, m4. Since class C extends class A, class C does have access to the protected method, m2, of class A. |