Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: supercalifragilisticexpialadiamaticonormalizeringelimatisticantations Newsgroups: comp.lang.java.programmer Subject: Re: Why "lock" functionality is introduced for all the objects? Date: Sat, 02 Jul 2011 00:19:35 -0400 Organization: supercalifragilisticexpialadiamaticonormalizeringelimatisticantations Lines: 16 Message-ID: References: NNTP-Posting-Host: 4/raLmFi1848LMFwwllsmA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: WinVN 0.99.12z (x86 32bit) X-Notice: Filtered by postfilter v. 0.8.2 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5818 On 01/07/2011 9:28 PM, Joshua Maurice wrote: > On Jun 28, 10:12 pm, > supercalifragilisticexpialadiamaticonormalizeringelimatisticantations > >> Sure, the boxed primitives and Strings are immutable, and that's about >> it. We've got mutable stuff out the wazoo, most of which probably >> shouldn't be -- java.util.Date, anyone? Not to mention java.awt.Point >> and friends. > > If you want a functional language, go use a functional language and > stop complaining that Java is not a functional language. Contrary to popular belief, immutability is not solely useful in a functional language. In fact, OO languages benefit greatly if their "value types" (things you're likely to want to use as hash keys and to generally represent state) are immutable.