자바에서는 String인스턴스의 데이터 변경을 허용하지 않는다고 했는데 다음과 같이 str2의 문자열을 변경해도 컴파일이 되네요?

제가 개념을 잘못 이해한 것 같은데 조금 쉽게 설명해주셨으면 합니다ㅠㅠ


class ImmutableString
{
 public static void main(String[] args)
 {
  String str1 = "My Story";
  String str2 = "My Story";
  String str3 = "Your Story";
  
  str2 = "Your Story";
  
  if(str1 == str2)
   System.out.println("동일 인스턴스 참조");
  else
   System.out.println("다른 인스턴스 참조");

  if(str2 == str3)
   System.out.println("동일 인스턴스 참조");
  else
   System.out.println("다른 인스턴스 참조");
 }
}