1. Use final keyword to declare final keyword in java.
  2. Declare final variable in java program.
  3. Predict errors when final variable is not properly used in a java program.

Final Variable in JAVA video tutorial (Hindi)

Vineet Agrawal

Published on January 12, 2017
  1. Final variable can be declared and initialized only when it is declared.
  2. Final variable can't be updated anywhere else in the program.
  3. You can declare a final class variable using final keyword.

This program demonstrate a java program that use final keyword.


class finalKeyword
{
	final int a=5;
	public static void main(String args[])
	{
		finalKeyword fin = new finalKeyword();
		fin.a=5;
	}
}
This content is part of the following course: 
Tags: 
Frequently Asked Questions
Required Components