Given:
Which statement is true?
Given:
Which statement is true?
A compilation error occurs in Cake because it attempts to extend Cream, which is a final class. In Java, a final class cannot be inherited by any other class. Therefore, Cake cannot extend Cream and this will result in a compilation error.
Answer B. Tested
Cream is a final class. How Cake class can extend Cream class? Cake class should cause a compile error.
Final class can not extends by another class
B, you cannot extend a final class
Answer is B Compilation error in Cake class
B is correct, as Cream class is final and cannot be extended.
Answer B. Tested
Answer is B.
Cream as a final class so it cannot be inherited any class that extends Cream class with throw a compile error
Answer B
It should have been B.