>> if ( (charsDisplayedCount += name.length()) > 80 ) >Rather than doing all of this massive and expensive string concatenation, >wouldn't it be easier to do some simple math? I suggest that you >calculate the number of iterations ahead of time.
Surely I'm *NOT* doing a String concatenation as the length() method of the String class simply returns an int?
Am I missing something here? If I do has suggested, my code seems to grow by another 5 lines and would be more complex !!
are you doing string concatenation somewhere else? in my final solution, the program would do exactly one concatenation. perhaps the comment isn't referring to this exact line, but your more general program flow...
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
I hesitate to try to interpret a nitpick out of context, but I wonder if maybe it refers to the calcalation as opposed to a concatenation. (Some of this nitpicking business gets done at less than ideal times of day, and, well, you know how that can go.)
Is that particular line inside a loop? If you can, it's usually a good idea to pull a calculation out of a loop for optimization reasons.
Looks like you're on Java 1b, and that one can be a real stickler in disguise. Hang in there!