Question in K&B Book - protected class
4. Which two of the following are legal declarations for nonnested classes and interfaces?
(Choose two.)
A. final abstract class
Test {}
B. public static interface Test {}
C. final public class Test {}
D. protected abstract class Test {}
E. protected interface Test {}
F. abstract public class Test {}
df
he give answer is:
C, F. Both are legal class declarations.
A is wrong because a class cannot be abstract and final�there would be no way
to use such a class. B is wrong because interfaces and classes cannot be marked as static.
D and E are wrong because classes and interfaces cannot be marked as protected.
???Classes cannot use protected.