0

I am writing the following method in java that returns all odd numbers less than n. I have to write JavaDoc for this method.I am a little new to writing JavaDoc. Is the following JavaDoc for this method correct?

For @return should I say "ArrayList of the all odd numbers less than n" or "list of all odd numbers less than n"?

Lastly, what should I say for @param n?

 /**
 * Return a list of all odd numbers less than n
 * 
 * @param n
 * @return ArrayList<Integer> of the all odd numbers less than n
 */
public static ArrayList<Integer> oddsLessThan(int n){

}

Any suggestions would be appreciated.

Jack Kong
  • 109
  • 1
  • 10
  • The duplicate will point you in the direction of good examples of Javadoc. Spring has some of the best and most thoroughly detailed docs around and it's worth it to peruse what they've done with their style, and try to capture that. – Makoto Sep 23 '17 at 23:59
  • Thanks ill have a look. However, could you please tell me how to describe @param n? – Jack Kong Sep 24 '17 at 00:04
  • @Makoto can I say @ param n number that all primes must be less than – Jack Kong Sep 24 '17 at 00:26
  • here is another [question](https://stackoverflow.com/questions/35902263/how-to-be-specific-enough-in-writing-javadoc/36038407#36038407) with an example. While writing documentation - always think of what the person that uses your method needs to know. – Rhayene Sep 26 '17 at 16:31

0 Answers0