This is a question of curiosity. Today I looked at the implementation StringBuilderand StringBuffer. Here's the method append():
public StringBuilder append(String str) {
super.append(str);
return this;
}
AbstractStringBuilder.append(str)also returns this. Are there any advantages of discarding the return value (in StringBuilder.append(..)) and returning thisagain, instead of returning the return value of the call superfor the current specific implementation.
Bozho source
share