What is the use of final keyword ?
Javasearch.buggybread.com

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.
Label / Company      Label / Company / Text

   



Interview Questions and Answers

 Q1. What is the use of final keyword ?Core Java
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


Related Questions

  What is the difference between final, finally and finalize() ?
  Difference between final and effectively final ? Why is effectively final even required ?
  Which of the following combination of keywords is illegal in Java ?

a. static and transient
b. transient and final
c. static and synchronized
d. abstract and final
  What is a final method ?
  Which keyword is used to provide explicit access of a code block to single thread ?

a. Transient
b. Final
c. Explicit
d. Synchronized
  Enums cannot be declared ..
  What is a Final Variable ?
  Should we override finalize method ?
  Will the static block be executed in the following code ? Why ?
  Can we override compareTo method for Enumerations ?



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: