Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Wojtek Newsgroups: comp.lang.java.programmer Subject: Assigning void Date: Fri, 12 Oct 2012 22:54:57 -0700 Organization: A noiseless patient Spider Lines: 24 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15"; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: mx04.eternal-september.org; posting-host="02a139954f423f27040ed3cd2ab90b3b"; logging-data="28545"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19hh6tnyVveB/oEw686oqs45x2K0crzy+M=" X-Newsreader: MesNews/1.08.03.00-gb Cancel-Lock: sha1:3dAWDK8u3tMs354l+Lit4QpKJiA= Xref: csiph.com comp.lang.java.programmer:19275 I can legally do the following: if (server.getConnectionType() == ConnectionType.ACTIVE) ftp.enterLocalActiveMode(); else ftp.enterLocalPassiveMode(); but I want to do: (server.getConnectionType() == ConnectionType.ACTIVE) ? ftp.enterLocalActiveMode() : ftp.enterLocalPassiveMode(); However the compiler insists that I must have an assignment even though both ftp methods return void. I would think that the compiler would be smart enough to realize that nothing CAN be returned. Oh yes, I am using Eclipse with Java 7 Thoughts? I mean other than stylistic comments... -- Wojtek :-)