X-Received: by 10.224.189.78 with SMTP id dd14mr9719098qab.0.1362148941322; Fri, 01 Mar 2013 06:42:21 -0800 (PST) X-Received: by 10.49.15.100 with SMTP id w4mr1135868qec.26.1362148941295; Fri, 01 Mar 2013 06:42:21 -0800 (PST) Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!dd2no4157790qab.0!news-out.google.com!y6ni555qaj.0!nntp.google.com!t2no6034347qal.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Fri, 1 Mar 2013 06:42:20 -0800 (PST) In-Reply-To: <51306447$0$1206$ba4acef3@reader.news.orange.fr> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=97.92.20.74; posting-account=xYT-TgoAAADBTvxoYZremJFI7beESf_a NNTP-Posting-Host: 97.92.20.74 References: <38e873e0-549a-417c-b45b-9b9d52f65880@googlegroups.com> <51306447$0$1206$ba4acef3@reader.news.orange.fr> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Boolean From: odie4penname@gmail.com Injection-Date: Fri, 01 Mar 2013 14:42:21 +0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Xref: csiph.com comp.lang.java.programmer:22649 On Friday, March 1, 2013 12:18:15 AM UTC-8, JLP wrote: > Le 01/03/2013 08:22, odie4penname@gmail.com a =E9crit : >=20 > > Hello everyone, >=20 > >=20 >=20 > > I'd like to make sure I have done this correct. I am using BluJ: >=20 > >=20 >=20 > > Create a public boolean method named >=20 > > MynumberisOdd that takes an integer parameter named=20 >=20 > > num and returns a boolean value indicating whether num is Odd. >=20 > >=20 >=20 > > The method should check if num is odd and return true when the number i= s odd and false when the number is even >=20 > >=20 >=20 > > Here is what I have: >=20 > >=20 >=20 > >=20 >=20 > > public class example >=20 > >=20 >=20 > > { >=20 > > public static void main(String [] args) >=20 > > { >=20 > > int x=3D1; >=20 > >=20 >=20 > > } >=20 > >=20 >=20 > > public boolean isNumberOdd (int num) >=20 > > { >=20 > > return num%2 !=3D0; >=20 > > =20 >=20 > >=20 >=20 > > =20 >=20 > > } >=20 > > } >=20 > >=20 >=20 >=20 >=20 > in method main >=20 > System.out.println(new example().isNumberOdd(1)); >=20 >=20 >=20 > Nota : Class names must start with a capital letter =3D> Example Thanks. I didn't mention this part of the requirements: This method does NOT produce any output itself (it does NOT call print, pri= ntln, or printf=20 inside its method body=97the calling code does that for the execution!). Is this correct? This is what I have now: public class Example { public static void main(String [] args) { int x=3D1; =20 System.out.println(new Example().isNumberOdd(1)); =20 } public boolean isNumberOdd (int num) { return num%2 !=3D0; =20 =20 } }