Re: Abstract interface methods?

From: xarax (xarax_at_email.com)
Date: 04/30/04


Date: Fri, 30 Apr 2004 14:08:09 GMT


"Tony Morris" <dibblego@optusnet.com.au> wrote in message
news:c6rrpn$qhe$1@news.btv.ibm.com...
> "Josef Garvi" <josef@eden-foundation.org> wrote in message
> news:c6r1cf$eljsf$1@ID-194406.news.uni-berlin.de...
> > I saw today that I can declare an interface method as abstract:
> >
> > public interface MyInterface {
> > public abstract void doSomething();
> > }
> >
> > What purpose would this serve?
> > I mean, all methods in an interface are abstract by nature....
> >
> > --
> > Josef Garvi
> >
> > "Reversing desertification through drought tolerant trees"
> > http://www.eden-foundation.org/
> >
> > new income - better environment - more food - less poverty
>
> An interface method is implicitly abstract, and public.
> An interface member is implicitly public, static and final.
>
> To provide explicit, redundant modifiers to interface methods/members is
> poor form (Java Language Specification Second Edition).

It is poor form to blindly follow Sun's style
recommendations, especially if it's style taken
from their code. Sun got it wrong wrt interface
style.