If I have a StringBuilder object sb, what's the time complexity when I try to create a new string with the code new String(sb)? See below for an example. Should it be O(n) since it creates a string with a deep copy of the original sb? Thanks.
StringBuilder sb = new StringBuilder();
sb.append('a');
sb.append('b');
String c = new String(sb);