Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #7086
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.16.MISMATCH!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!y8g2000prd.googlegroups.com!not-for-mail |
|---|---|
| From | Chad <cdalten@gmail.com> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: A question about a few variables in a class |
| Date | Sat, 13 Aug 2011 10:27:00 -0700 (PDT) |
| Organization | http://groups.google.com |
| Lines | 30 |
| Message-ID | <28e6227e-c66f-4f55-981a-6b9cfeab1a72@y8g2000prd.googlegroups.com> (permalink) |
| References | <c5422014-46bd-4c77-9302-839b5cb587a2@a2g2000prf.googlegroups.com> <047f307c-06f3-4a8b-9856-3849ad9e888e@glegroupsg2000goo.googlegroups.com> |
| NNTP-Posting-Host | 66.81.41.11 |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | quoted-printable |
| X-Trace | posting.google.com 1313256420 6833 127.0.0.1 (13 Aug 2011 17:27:00 GMT) |
| X-Complaints-To | groups-abuse@google.com |
| NNTP-Posting-Date | Sat, 13 Aug 2011 17:27:00 +0000 (UTC) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | y8g2000prd.googlegroups.com; posting-host=66.81.41.11; posting-account=kTs1ygoAAACgG1TSoyECpovEyy-V6_8b |
| User-Agent | G2/1.0 |
| X-Google-Web-Client | true |
| X-Google-Header-Order | ARLUEHNKC |
| X-HTTP-UserAgent | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.2),gzip(gfe) |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7086 |
Show key headers only | View raw
On Aug 10, 9:14 am, Lew <lewbl...@gmail.com> wrote:
> Chad wrote:
> > Let's say I have the following class.....
>
> > public class ComparableRectangle extends Rectangle implements
> > Comparable {
>
> Don't use raw types.
>
> > public ComparableRectangle(double width, double height) {
> > super(width, height);
> > }
>
> > public int compareTo(Object o) {
> > if (getArea() > ((ComparableRectangle)o).getArea())
>
> Don't cast 'o' because it will be of the correct type if you declare your class correctly, which you didn't.
>
> public int compareTo( ComparableRectangle o )
> ...
>
> Seehttp://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html
>
For reasons that elude me, the web based browser for google groups
wouldn't display anything after Aug. 1 until a few days ago. With
that, the example was taken from the book we use at school.
Chad
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
A question about a few variables in a class Chad <cdalten@gmail.com> - 2011-08-05 14:31 -0700
Re: A question about a few variables in a class markspace <-@.> - 2011-08-05 14:46 -0700
Re: A question about a few variables in a class Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-06 07:56 -0400
Re: A question about a few variables in a class Chad <cdalten@gmail.com> - 2011-08-13 10:30 -0700
Re: A question about a few variables in a class Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-13 20:49 -0400
Re: A question about a few variables in a class Chad <cdalten@gmail.com> - 2011-08-14 13:23 -0700
Re: A question about a few variables in a class markspace <-@.> - 2011-08-14 13:52 -0700
Re: A question about a few variables in a class Lew <lewbloch@gmail.com> - 2011-08-14 22:50 -0700
Re: A question about a few variables in a class Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-14 18:04 -0400
Re: A question about a few variables in a class Chad <cdalten@gmail.com> - 2011-08-14 17:09 -0700
Re: A question about a few variables in a class Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-14 21:57 -0400
Re: A question about a few variables in a class Lew <lewbloch@gmail.com> - 2011-08-14 22:55 -0700
Re: A question about a few variables in a class Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-14 18:01 -0400
Re: A question about a few variables in a class Roedy Green <see_website@mindprod.com.invalid> - 2011-08-06 22:58 -0700
Re: A question about a few variables in a class Patricia Shanahan <pats@acm.org> - 2011-08-07 05:28 -0700
Re: A question about a few variables in a class Lew <lewbloch@gmail.com> - 2011-08-10 09:14 -0700
Re: A question about a few variables in a class Chad <cdalten@gmail.com> - 2011-08-13 10:27 -0700
Re: A question about a few variables in a class Patricia Shanahan <pats@acm.org> - 2011-08-14 18:36 -0700
csiph-web