Skip to content

Commit 15c5406

Browse files
authored
Update JavaExamples.java
1 parent 10a07e3 commit 15c5406

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

JavaExamples.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ void foo(Set<String> s) {
1212
// Mutating immut set, `new_s` is immut
1313
void foo1(@Mutable Set<String> s) {
1414
Set<String> new_s = new HashSet<>(s);
15+
Set<String> new_s1 = s;
1516
new_s.add("x"); // ERROR
17+
new_s1.add("x"); //OK
1618
}
1719

1820
// Mutating mut set

0 commit comments

Comments
 (0)