r suraaj wrote:Hi.,
my doubt is about final keyword.,
i think a variable whether it is primitive or reference variable ., when it is declared as final variable we can't modify that value.,
but can we assign a final reference variable of an object to another reference variable of the same class?
It depends.
You can do something like this:
But you can't do this:
Once the reference variable is assinged an object, the reference cannot be changed. Note that the object state can change, such as below:
SCJA
When I die, I want people to look at me and say "Yeah, he might have been crazy, but that was one zarkin frood that knew where his towel was."