About Question enthuware.ocajp.i.v8.2.989 :
Posted: Sat Jul 29, 2017 3:39 pm
This question asks about emptying the contents of a StringBuilder called sb. The answer I chose is "wrong", but I tried the code and it works:
sb.delete(0,sb.length());
The "right" answer is:
sb.clear();
Why isn't sb.delete(0,sb.length()) correct also?
I appreciate any clarification on this. Thank you so much!
sb.delete(0,sb.length());
The "right" answer is:
sb.clear();
Why isn't sb.delete(0,sb.length()) correct also?
I appreciate any clarification on this. Thank you so much!