Path: csiph.com!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Jeff Higgins Newsgroups: comp.lang.java.programmer Subject: Re: Assigning void Date: Sat, 13 Oct 2012 14:26:12 -0400 Organization: A noiseless patient Spider Lines: 35 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 13 Oct 2012 18:20:07 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="6a6a291fa7e9c0bd872c1a9cbe2b371d"; logging-data="9653"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18KkL/rjbx5o16NlNa8FA3Vvb47NeK6K4c=" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20120925 Icedove/3.0.11 In-Reply-To: Cancel-Lock: sha1:cV1dXsYb9G7+f9lXbZybPQOEjPI= Xref: csiph.com comp.lang.java.programmer:19285 On 10/13/2012 01:05 PM, glen herrmannsfeldt wrote: > Jeff Higgins wrote: > > (snip) > >>> (server.getConnectionType() == ConnectionType.ACTIVE) ? >>> ftp.enterLocalActiveMode() : ftp.enterLocalPassiveMode(); > > (snip) > >> Others have pointed you to the specification. >> I don't know why it can't be a shorthand if-then-else statement too. > > Java isn't C. > > Java allows for method calls that return a value to ignore the > return value, but other expressions that don't use the value > seem not to be allowed. > > 2+2; > > is legal C, but not Java. > C has its Rationale. Java seems not to have a separate formal one. 6.5.15 of the C Rationale only states the construct is allowed and not why. 15.25 of the Java Spec. only states the construct is disallowed and not why. Does it sound childish to ask why?