Strings are mutable in C++, but immutable in java. So it is better to use std::string only in c++, while stringstream is better for java Improves string concatenation, if say there's an empty string ...