Given:
and
What is the result?
Given:
and
What is the result?
The compilation fails because class X is declared as final, which means it cannot be extended by any other class. In the given code, class Y is trying to extend class X, causing a compile-time error.
Answer: D
D is correct since X is final,it can't be overriden
Since final class cannot be "extended"not overriden :D
D is the correct answer. Since final class cannot be inherited/extended.