Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.help > #2066
| Received | by 10.66.74.10 with SMTP id p10mr2411305pav.17.1346188128641; Tue, 28 Aug 2012 14:08:48 -0700 (PDT) |
|---|---|
| Received | by 10.68.129.69 with SMTP id nu5mr3856916pbb.17.1346188128625; Tue, 28 Aug 2012 14:08:48 -0700 (PDT) |
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!r4no870712pbs.0!news-out.google.com!t10ni106882016pbh.0!nntp.google.com!4no23680392pbn.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | comp.lang.java.help |
| Date | Tue, 28 Aug 2012 14:08:48 -0700 (PDT) |
| In-Reply-To | <k1ieav$nqm$1@dont-email.me> |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T |
| NNTP-Posting-Host | 69.28.149.29 |
| References | <895c9d20-3ae1-4eee-b1a4-513e75b93fdb@c4g2000vbe.googlegroups.com> <k1h476$57q$1@dont-email.me> <d2228972-1080-4803-bb99-7355b11148ea@l14g2000yqo.googlegroups.com> <k1ieav$nqm$1@dont-email.me> |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <57b88270-eafb-4cdc-b558-63dca0183366@googlegroups.com> (permalink) |
| Subject | Re: newbie interface question |
| From | Lew <lewbloch@gmail.com> |
| Injection-Date | Tue, 28 Aug 2012 21:08:48 +0000 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Xref | csiph.com comp.lang.java.help:2066 |
Show key headers only | View raw
Eric Sosman wrote: >happytoday wrote: >> Eric Sosman wrote: >>> happytoday wrote: >>>> I am testing interface but really I can not apply what is explained in >>>> oracle [sic] tutorials . Could you please explain why I have errors with >>>> this code : >>>> [...] >>> What "errors" do you have? For me, the code compiles just >>> fine, and runs [...] > >> prog01_BicycleDemo_interface_trial01.java:62: printresults() in >> ACMEBicycle cannot implement printresults() in Bicycle; attempting to >> assign weaker access privileges; was public >> void printresults() >> ^ > > Aha! So by "this code" you meant "some other piece of code > altogether," right? Do you know how many times "ACME" appears > in the code sample you posted? Z E R O times, that's how many. > > Unfortunately, I am not sufficiently skilled to debug code > that I cannot see. My guess (but I'm only guessing) is that > you've converted Bicycle from a class to an interface, thus > making its methods public automatically even if you don't use > the `public' keyword. Then (still guessing) you've written an > ACMEBicycle class that implements Bicycle, and you've tried to > give it an implementation of the printresults() method specified > by the Bicycle interface. But the interface says printresults() > must be a `public' method, while ACMEBicycle's printresults() > isn't marked `public'. > > There are other possible explanations, but I'm tired of > guessing about unseen code and my Magic 8 Ball has a virus. "All indications point to No!" The Magic Infinity Ball (you were looking at yours sideways) only answers "Yes" or "No" questions. Fortunately the OP asked a "Yes" or "No" question. -- Lew
Back to comp.lang.java.help | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: newbie interface question Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-08-27 20:43 -0400
Re: newbie interface question Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-08-28 08:42 -0400
Re: newbie interface question Lew <lewbloch@gmail.com> - 2012-08-28 14:08 -0700
Re: newbie interface question Gene Wirchenko <genew@ocis.net> - 2012-08-28 17:21 -0700
Re: newbie interface question Roedy Green <see_website@mindprod.com.invalid> - 2012-08-29 08:26 -0700
csiph-web