How to concatenate int values in java?

The easiest (but somewhat dirty) way:

String result = "" + a + b + c + d + e

Edit: I don’t recommend this and agree with Jon’s comment. Adding those extra empty strings is probably the best compromise between shortness and clarity.

Leave a Comment