Search Interview Questions | ![]() ![]() Click here and help us by providing the answer. ![]() Click Correct / Improve and please let us know. |
|
| |||||||||||
Core Java - Interview Questions and Answers for 'Final class' - 4 question(s) found - Order By Newest | |||||||||||
![]() | |||||||||||
| |||||||||||
Ans. A Class that cannot be sub classed. | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() ![]() ![]() ![]() ![]() ![]() | |||||||||||
| |||||||||||
Ans. Yes, to a certain extent. But the objective for Final class could be beyond just enforcing composition as certain classes might have been created without inheritance or composition in mind. | |||||||||||
![]() | |||||||||||
![]() ![]() ![]() ![]() | |||||||||||
| |||||||||||
Ans. 1. Enforcing composition over inheritance 2. Restricting overriding of certain methods 3. Final methods are faster than regular instance methods 4. Enforcing Immutability | |||||||||||
![]() | |||||||||||
![]() ![]() ![]() ![]() | |||||||||||
| |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() ![]() ![]() ![]() ![]() | |||||||||||
| |||||||||||