On Thu, 28 Feb 2002, Christopher Elkins wrote:
> > I've always liked the public modifier, but I guess it is completely
> > redundant. I'll try to change my ways in the future.
> 
> Yeah, there's nothing technically _wrong_ it. (The JLS doesn't explicitly
> say as such.) However, it tends to pollute the build output (in Jikes, anyway)
> and potentially masks warnings that are actually important. :-)

Actually, while the JLS doesn't say its "wrong" (otherwise the compiler 
wouldn't accept it), it is highly discouraged.  To quote the relevent 
section of the java language specification (section 9.4):

"It is permitted, but strongly discouraged as a matter of style, to
redundantly specify the public modifier for interface methods."

This is actually true for the "abstract" modifier as well (at a previous 
employer, all interfaces had "public abstract"):

"For compatibility with older versions of the Java platform, it is
permitted but discouraged, as a matter of style, to redundantly specify
the abstract modifier for methods declared in interfaces."

reference:
http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html#78651

regards,
michael



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to