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 keyword' - 6 question(s) found - Order By Rating | ||||
| ||||
Ans. Yes. As they cannot be overridden , there is no use of virtual table concept which is used for dynamic binding resolution. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  final methods   final keyword 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 | ||||
| ||||
Ans. final when assigned to object references doesn't make them immutable. It means that the references cannot be de-referenced. final when applied to variables means that the value cannot be changed. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  final keyword  final variable | ||||
| ||||
Ans. final keyword have meaning only to referenced and not the value. It means that the specified reference cannot be dereferenced. It doesn't control the value assigned to the memory that's being referenced. This is the reason that final object references doesn't mean that the object is immutable but means that the reference cannot be changed to point to new object. In case of primitive types too, when we assign a reference to another, values are passed and not the object reference, and hence a new placeholder is created in memory with the same value. That is why final to that context means that you cannot change the assigned memory and there is no way we can have that memory place have another value. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  final keyword  final variables  references | ||||
| ||||
Ans. final keyword is a modifier that means differently when applied to variables, methods and classes. 1. Final variable cannot be changed once initialized 2. Final method cannot be overridden 3. Final class cannot be sub classed | ||||
Sample Code for final variable Sample Code for final method Sample Code for final class | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  final  final keyword Asked in 1 Companies Basic   frequent | ||||
| ||||
Ans. Yes, the array list can hold more elements. Final only puts the restriction that the array list reference cannot hold any other array list. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  ebay   collections   arraylist   final keyword | ||||