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 cla' - 4 question(s) found - Order By Rating | |||||||||||
| |||||||||||
| Ans. 1. Enforcing composition over inheritance 2. Restricting overriding of certain methods 3. Final methods are faster than regular instance methods 4. Enforcing Immutability | |||||||||||
| |||||||||||
| 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. A Class that cannot be sub classed. | |||||||||||
| |||||||||||