Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. 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 | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  final class   reasons for final class   restricting inheritance  object oriented programming (oops)  oops concepts expert | |||||||||||
| |||||||||||
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. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  final class   composition  object oriented programming (oops)  oops concepts  inheritance  object oriented programming (oops)  oops concepts  composition  object oriented programming (oops)  oops concepts vs inheritance  object oriented programming (oops)  oops concepts expert | |||||||||||
| |||||||||||
This question was recently asked at 'Avis'.This question is still unanswered. Can you please provide an answer. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  final class   final keyword Asked in 1 Companies basic | |||||||||||
Very Frequently asked.Favorite question in Walk in drive for many Indian service companies. | |||||||||||
| |||||||||||
Ans. A Class that cannot be sub classed. | |||||||||||
Sample Code for final class | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  java   oops   final   final class   java keyword   basic interview question Asked in 3 Companies basic   frequent | |||||||||||
| |||||||||||