xen
(stranger)
09/09/07 08:56 PM
String concatenation in 1.6

I do not know whether this is a new aspect of 1.5 or 1.6, but I've noticed that when I concatenate two strings using Code:
String s = "abc" + i + "def";

(where i is an integer < 10) the resulting String has array size 7. Also, Code:
new StringBuffer("abc").toString()

will give me a String size 3. So there's no need to use .concat anymore.



Contact us JavaWorld

Powered by UBB.threads™ 6.5.5

Featured White Papers


RESEARCH CENTERS: Java Standard Edition | Java Enterprise Edition | Java Micro Edition | Development Tools
About Us | Advertise | Contact Us | Terms of Service/Privacy
Copyright, 2006-2008 Network World, Inc. All rights reserved.