Today class is about final parameters. final parameter defines if we to keep the things constant ,then final parameter will be used.
We got lots of doubt in it. Sir make as out of clarification.
You can pass final variables as the parameters to methods in Java. A final variable can be explicitly initialized only once. A reference variable declared final can never be reassigned to refer to a different object. However, the data within the object can be changed.So, the state of the object can be changed but not the reference. With variables, the final modifier often is used with static to make the constant a class variable.
public class Test{
public void sample(final int data){
System.out.println(data);
}
public static void main(String args[]) throws Exception{
Test t = new Test();
t.sample(500);
}
}