I am trying to understand what happens if I reassign a value to array element which is final, this is the code :
public class XYZ {
private static final
When final
is applied to a variable, that only means that it cannot be reassigned once initialized. That does not prevent the object itself from being modified. In this case, you are modifying the array object. So this is fine:
ABC[0] = " World!!!";
But this would not have been allowed.
ABC = new String[]{" World!!!"};