The pages of this web site are not formatted to conserve paper, but my new book (ISBN: 0-9745862-0-X) is formatted to save paper, save your printer cartridge, save a loose-leaf binder, and save money. If you prefer to work my exams from printed pages, then give your printer a rest and buy my new book.
Today, you can find my book at amazon.com.
| 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. |