Given:



Which statement is true?

A. A compilation error occurs in IceCream.
B. A compilation error occurs in Cake.
C. A compilation error occurs in Shop.
D. A compilation error occurs in Bread
E. All classes compile successfully.

題解

Bread.java第三行的bake方法會編譯錯誤,因為Bread類別繼承的Cake類別,其bake方法已經使用了final來修飾,無法被覆寫。