a quick question about String

Bernd Eckenfels ecki at zusammenkunft.net
Thu Dec 23 21:51:55 UTC 2021


new String() always creates a new instance.

Gruss
Bernd
--
http://bernd.eckenfels.net
________________________________
Von: core-libs-dev <core-libs-dev-retn at openjdk.java.net> im Auftrag von Alan Snyder <javalists at cbfiddle.com>
Gesendet: Thursday, December 23, 2021 6:59:18 PM
An: core-libs-dev <core-libs-dev at openjdk.java.net>
Betreff: a quick question about String

Do the public constructors of String actually do what their documentation says (allocate a new instance), or is there some kind of compiler magic that might avoid allocation?



More information about the core-libs-dev mailing list