Consider the program to test visibility in Figure 48.
a. Which accesses are illegal?
b. Make main a method in Base. Which accesses are illegal?
c. Make main a method in Derived. Which accesses are illegal?
d. How do these answers change if protected is removed from line 4?
e. Write a three-parameter constructor for Base. Then write a fiveparameter constructor for Derived.
f. The class Derived consists of five integers. Which are accessible to the class Derived?
g. A method in the class Derived is passed a Base object. Which of the Base object members can the Derived class access?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here