[784] in java-interest

home help back first fref pref prev next nref lref last post

Re: /** method must be there, or type expected error

daemon@ATHENA.MIT.EDU (Tientien Li)
Thu Jul 20 01:48:16 1995

From: li@deming.Jpl.Nasa.Gov (Tientien Li)
To: scott@plato.ds.boeing.com (Scott Moody)
Date: Wed, 19 Jul 1995 21:15:27 -0700 (PDT)
Cc: java-interest@java.sun.com
In-Reply-To: <9507191703.AA28865@plato.ds.boeing.com> from "Scott Moody" at Jul 19, 95 10:03:54 am

Scott,

"/**" is treated differently in Java, see Section 2.1 of the manual.

2.1 Comments

The Java language has three styles of comments:

// text 
     All characters from // to the end of the line are ignored. 
/* text */ 
     All characters from /* to */ are ignored. 
/** text */ 
     These comments are treated specially when they occur immediately
     before any declaration.  They should not be used any other place
     in the code. These comments indicate that the enclosed text should
     be included in automatically generated documentation as a description
     of the declared item.

--
Tientien Li
li@deming.jpl.nasa.gov 

> 
> I just noticed that the java parser wants the method that goes
> with /** commented info (since it keeps this comment with the method).
> 
> Well if you happen to comment out the routine (for say testing) then
> the compiler burps wanting a 'type'.
> 
> So one must comment out the entire routine plus comment 
> (or change the comment to /* or //)
> 
> eg.
>     /**   
>     * this updates the applet
>     */
>     //public void update(Graphics g) {
>         //g.clearRect(0,0,100,100);
>     //}
> 
> ^ 1 error (type expected)
> 
> ---
> So this should either be documented as a 'feature' or looked into. I know
> the lookahead is a problem. But you don't want novices trying to figure
> the strange error.
> 
> -scott
> 
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post