Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/* (non-javadoc) meaning [duplicate]

Possible Duplicate:
Does “/* (non-javadoc)” have a well-understood meaning?

What does the following statements mean?

    /* (non-Javadoc)      *       * Standard class loader method to load a class and resolve it.      *       * @see java.lang.ClassLoader#loadClass(java.lang.String)      */     @SuppressWarnings("unchecked") 
like image 815
Mian Asbat Ahmad Avatar asked Mar 02 '11 20:03

Mian Asbat Ahmad


People also ask

What is Javadoc commenting?

In general, Javadoc comments are any multi-line comments (" /** ... */ ") that are placed before class, field, or method declarations. They must begin with a slash and two stars, and they can include special tags to describe characteristics like method parameters or return values.

What is the difference between Javadoc and comments?

Documentation comments (known as "doc comments") are Java-only, and are delimited by /**... */ . Doc comments can be extracted to HTML files using the javadoc tool. Implementation comments are meant for commenting out code or for comments about the particular implementation.

Should I use Javadoc comments?

Before using JavaDoc tool, you must include JavaDoc comments /**……………….. */ providing information about classes, methods, and constructors, etc. For creating a good and understandable document API for any java file you must write better comments for every class, method, constructor.


1 Answers

Javadoc looks for comments that start with /**. By tradition, method comments that are not intended to be part of the java docs start with "/* (non-Javadoc)" (at least when your dev environment is Eclipse).

As an aside, avoid using multi-line comments inside methods. For example, avoid this:

public void iterateEdges() {   int i = 0;    /*     * Repeat once for every side of the polygon.    */   while (i < 4)   {   }  } 

The following is preferred:

public void iterateEdges() {   int i = 0;    // Repeat once for every side of the polygon.   while (i < 4)   {     ++i;   }  } 

The reason is that you open the possibility to comment out the entire method:

/* public void iterateEdges() {   int i = 0;    // Repeat once for every side of the polygon.   while (i < 4)   {      ++i;   }  } */  public void iterateEdges() {   // For each square edge.   for (int index = 0; index < 4; ++index)   {   } } 

Now you can still see the old method's behaviour while implementing the new method. This is also useful when debugging (to simplify the code).

like image 62
DwB Avatar answered Sep 30 '22 14:09

DwB