KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > InputTrailingComment


1 public class InputTrailingComment {
2     int i; // don't use trailing comments :)
3
// it fine to have comment w/o any statement
4
/* good c-style comment. */
5     int j; /* bad c-style comment. */
6     void method1() { /* some c-style multi-line
7                         comment*/

8         Runnable JavaDoc r = (new Runnable JavaDoc() {
9                 public void run() {
10                 }
11             }); /* we should allow this */
12     } // we should allow this
13
/*
14       Let's check multi-line comments.
15     */

16     /* c-style */ // cpp-style
17
/* c-style 1 */ /*c-style 2 */
18
19     void method2(long ms /* we should ignore this */) {
20         /* comment before text */int z;
21         /* int y */int y/**/;
22     }
23
24     /**
25      * comment with trailing space
26      */

27     final static public String JavaDoc NAME="Some Name"; // NOI18N
28
}
29
Popular Tags