HI guys, I have an interesting example aken from the OCA book, quite confusing for me I have to admit.
OK, so here is the code:
Right, this is the way I thought I'd have solved it.
sub essentially contains 'anim', but what I thought was that this
would have had an effect even on sb itself, changing its value from "animals" to "anim", reason being there is only one StringBuilder object which isn't immutable so I don't need to store its reference anywhere: a bit as if I would have done this sb.append("b"), which would have changed the
string to "animalsb" presumably?