A well-known inefficiency in Java involves string concatenation. The way around this problem is to ensure that the concatenation is done within a single statement. This facilitates a compiler optimization in which successive arguments to the "+" operator are silently translated into calls to a hidden Stri ngBuf f er instance, resulting in more efficient construction of the string from its constituent parts.
展开▼