Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #36193

Re: I am unable to run my Bluej Code

Path csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Andreas Leitgeb <avl@logic.at>
Newsgroups comp.lang.java.programmer
Subject Re: I am unable to run my Bluej Code
Date Sat, 14 Jan 2017 20:23:28 -0000 (UTC)
Organization A noiseless patient Spider
Lines 17
Message-ID <slrno7l268.pvm.avl@logic.at> (permalink)
References <7bbab5d9-5eca-406b-bd0d-bb7caa28525a@googlegroups.com> <c95dbb71-a5e4-4752-99b1-4772bced1c3c@googlegroups.com>
Reply-To avl@logic.at
Injection-Date Sat, 14 Jan 2017 20:23:28 -0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="b25bc1c2b925ca07c60e294da0b786ef"; logging-data="7873"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Yb8oJMo+utZNqSE9Mj99a"
User-Agent slrn/1.0.2 (Linux)
Cancel-Lock sha1:grO01yBzc9a4ajgitZfH7qZuQK4=
Xref csiph.com comp.lang.java.programmer:36193

Show key headers only | View raw


lewbloch@gmail.com <lewbloch@gmail.com> wrote:
> On Friday, January 13, 2017 at 7:16:32 PM UTC-8, Yesi Gebre wrote:
>> class ChkNum{
>>     //return true if x is even 
>>     boolean isEven(int x){
>>         if((x % 2) == 0) return true;
>>         else return false;
>>        }
>>     }
> `(x % 2) == 0` is already a boolean expression, so making it
> a conditional to turn it into a boolean is rather gilding the
> lily, wouldn't you say?

I wouldn't say.  OP's way makes it easier to add logging code
lateron.
Even better would be, if the statements were even "embraced".

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

I am unable to run my Bluej Code Yesi Gebre <yesi.gebreselassie@gmail.com> - 2017-01-13 19:16 -0800
  Re: I am unable to run my Bluej Code Andreas Leitgeb <avl@logic.at> - 2017-01-14 09:15 +0000
  Re: I am unable to run my Bluej Code lewbloch@gmail.com - 2017-01-14 11:36 -0800
    Re: I am unable to run my Bluej Code Andreas Leitgeb <avl@logic.at> - 2017-01-14 20:23 +0000
      Re: I am unable to run my Bluej Code Arne Vajhøj <arne@vajhoej.dk> - 2017-01-14 19:49 -0500
      Re: I am unable to run my Bluej Code lewbloch@gmail.com - 2017-02-12 11:06 -0800

csiph-web