I've used final keyword with class, method, fieldsbut this the first i'm seeing something like this
final Customer c=new Customer();
could anyone help me to get what is the use of this?
I've used final keyword with class, method, fieldsbut this the first i'm seeing something like this
final Customer c=new Customer();
could anyone help me to get what is the use of this?
it is constant reference - you cannot change its value it can be assigned only once when being defined
an example:
final String string = "initial value";
string += " some new content"; //here compiler will raise an error due to you cannot change final value