It is quite easy to answer by compiling the code and then checking the bytecode with javap -c . In this particular case, the compiler should generate code like
String result = new StringBuilder("string1"). append(text).append("string2").append("string3").toString();
therefore, depending on how you look at it, you can say only one, or if you are one of those people who like to consider literals βcreatedβ when they are used, you can say four.
source share