Output of String trim method on unassigned reference
Filed under UBS
The question
Given a String `Str = " abcd ";`, executing `Str.trim();`, and then printing `Str`, explain what output is produced and why String immutability influences the result.
No write-up yet. Related questions below have one.
Related UBS questions
Collected from public candidate posts and coding forums. Updated Nov 2026.