From 15c5406923cda51c0a87dbf84e22dfc984ace55e Mon Sep 17 00:00:00 2001 From: Jenny Xiang Date: Fri, 26 Apr 2024 12:24:50 -0700 Subject: [PATCH] Update JavaExamples.java --- JavaExamples.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/JavaExamples.java b/JavaExamples.java index 4c2ccaf..3babfd7 100644 --- a/JavaExamples.java +++ b/JavaExamples.java @@ -12,7 +12,9 @@ void foo(Set s) { // Mutating immut set, `new_s` is immut void foo1(@Mutable Set s) { Set new_s = new HashSet<>(s); + Set new_s1 = s; new_s.add("x"); // ERROR + new_s1.add("x"); //OK } // Mutating mut set