-5

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?

MarianD
  • 13,096
  • 12
  • 42
  • 54
asy
  • 23
  • 2

2 Answers2

2

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.

Trinopoty
  • 393
  • 3
  • 15
0

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.

harivis
  • 72
  • 3
  • 1
    It isn't an answer to the question, this piece of information the original poster already knows. – MarianD Jan 27 '17 at 08:07