when a variable is declared as final we cant change its value again. we use final variable to declare a constant so when we declare a variable as final and if we were allowed to not to give its value at the time of declaration it would not make sense so people who designed java made mandatory to give the value when we declare a final variable. then only it will be sensible.
final PI=3.14;
then we cant change PI's value. think if the above statement do not contain a vl it would not make sense.

3 Users have rated as useful.
Login to rate this answer.
A variable can be declared but when program execution is running one can change its variable but when it reaches a final result the varable cannot be changed..hence it is declared as final variable
Login to rate this answer.
In java its not necessary to initialize the variable as soon it is declared,
You can just define the final variable, and initialize it later.
as below
Code
public static void main
(String[] args
) {
xyz="bbc";
}
Login to rate this answer.
Sam
Answered On : Jul 6th, 2012
It is not necessary to initialize the final variable at the time of its declaration. We can initialize the final variable later also.This initialization can be done inside a constructor. The final variable declared in this manner is known as blank final variable
Code
public class A
{
final int x;
public A()
{
x=10;
}
}
Login to rate this answer.
Rohit Verma
Answered On : Jul 10th, 2012
Like any variable, a final variable can also be first declared and then assigned a value. But it can be only assigned a value once and only once ( as its final variable ).
for example :-
final String s1; // declared only - not assigned some value.
s1 = "test1"; // assigned value
s1 = "test2"; // not allowed. will not compile.
Similarly a final reference variable can only point to only object ( we can change the properties of object referred though )
Login to rate this answer.
final keyword can be applied on:-
1.class
2.member functions(only non-static)
3.data-members(both static and non-static)
4.local variables.
1.by making a class final ,that class cannot be inherited.
2.by making d function final,that function cannot be overriden by d child class.
3.by making local variable final,it will become final and we cannot change d value throughout d function.
4.for non-static data members,d value of data members for every object should be different,otherwise every variable would have d same value again and again.
so to avoid dis a new concept came i.e, Blank Final variable.
Login to rate this answer.