Can a final
class extend any other class? If so, then what is the use of the inheritance by a final
class?
Final
class can't be inherited but is it possible to extend any other class by a final
class?
Can a final
class extend any other class? If so, then what is the use of the inheritance by a final
class?
Final
class can't be inherited but is it possible to extend any other class by a final
class?
final
classes can extend other classes but cannot be extended from. You cannot declare a class that extends from a final class.
abstract
classes can only be extended by other classes and not used directly to create objects.
final classes are meant to be uninheritable. These classes are sealed from further extension by inheritance. final classes are used primarly to bring in immutability.