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.
Ans. Yes, it will compile without error. final in this context means that the reference hm cannot be assigned to a new hash map but didn't restrict from changing the state of collection already held by hm.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Being final in the sense of objects or object reference means that the reference cannot be reassigned to a different object whereas being immutable means that the object contents cannot be changed.
Strings in Java are immutable.
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  string  immutable  immutability  final vs immutable  immutability
Q45. How different is it when final applied to variables and object references ?
Ans. The regular behavior of exception handling will occur. It will look for any immediate catch handler and if none is provided, it would be transmitted to the callers until a catch handler is found or it's out of main function.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Returning from inside a finally block will cause exceptions to be lost. A return statement inside a finally block will cause any exception that might be thrown in the try block to be discarded.
Help us improve. Please let us know the company, where you were asked this question :