What does the `final` keyword do when applied to a variable?

Java Associate Easy

Java Associate — Easy

What does the `final` keyword do when applied to a variable?

Key points

  • `final` keyword ensures immutability of the variable
  • It is commonly used for constants in Java
  • Prevents accidental reassignment of the variable

Ready to go further?

Related questions