String objects are immutable. Concatenation and modification of string objects will eventually create a new string object.Concatenating strings in a loop creates a lot of objects and wastes the system's running time and space.You can use StringBuffer or StringBuilder instead of String for splicing
String objects are immutable. Concatenation and modification of string objects will eventually create a new string object.Concatenating strings in a loop creates a lot of objects and wastes the system's running time and space.You can use StringBuffer or StringBuilder instead of String for splicing
https://github.com/google/google-authenticator/blob/0e8cc0a3bcada1f8f35191bd0f9f95403da65ffc/mobile/blackberry/src/com/google/authenticator/blackberry/PasscodeGenerator.java#L102-L105