You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks @LongerFase for noticing this !
You are right that no hint is provided as of now , though this fails only at runtime and not at compile time .
If you check the Java Docs for the List interface it mentions that an UnsupportedOperationException shall be thrown in case one tries to modify an Unmodifiable List. Try the following code :-
var l=List.of("a","b ");
l.add("rr");
No error hint when coding,but compile error,because List.of return immutableCollection.
The text was updated successfully, but these errors were encountered: