Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 28 Jun 2011 15:44:47 -0500 Date: Tue, 28 Jun 2011 13:44:39 -0700 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Why "lock" functionality is introduced for all the objects? References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Lines: 17 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 70.230.196.78 X-Trace: sv3-ZAW8E9fB1pMvmAyB3/KqhyloPQepzkhCLvbLDGeZryAsv2OS01i8VsS0s3bQcOeKdAHiFM35wq8jOA1!sM8zflAVHh2aJlmNjT2AijAUUzuij7Bqz8ZGhj6/JmVs9YHKzM1iDcn1DN5PfhxLruiZmQwbJmLb!JzpdEiRIu5wz9117UiFS2x3XhGRmGDvYg6J1OWtHMaa7ow== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2247 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5752 On 6/28/2011 1:20 PM, markspace wrote: > On 6/28/2011 12:34 PM, Patricia Shanahan wrote: > >> If, for your purposes, minimal memory use is very important, you may >> want to consider other languages with other trade-offs. > > > Or rolling your own, via the CharSequence interface, for example. > I don't think that would solve the whole problem. There are many API constructors and methods that require String, not CharSequence. Also, I think the everything-lockable policy and the design of String are typical of Java design trade-offs that often consider memory footprint no more important than convenience and other aspects of efficiency. Patricia