How many lines should a class have Java?

How many lines should a class have Java?

Actually, the maximum recommended lines per class is 2000 lines. “Java Code Conventions” since 1999 have stated it this way: Files longer than 2000 lines are cumbersome and should be avoided.

How do you write a javadoc for a class?

The basic rule for creating JavaDoc comments is that they begin with /** and end with */….Adding JavaDoc comments

  1. Immediately before the declaration of a public class.
  2. Immediately before the declaration of a public field.
  3. Immediately before the declaration of a public method or constructor.

How long should methods be?

a) Methods should not have more than an average of 30 code lines (not counting line spaces and comments). b) A class should contain an average of less than 30 methods, resulting in up to 900 lines of code. c) A package shouldn’t contain more than 30 classes, thus comprising up to 27,000 code lines.

What do you need to know about Javadoc tags?

Javadoc is a document generator that looks through your Java source files for specific annotations. It parses out the annotations into the Javadoc output. Knowing the annotations is essential, since this is how the Javadoc gets created. Common Javadoc tags. Comments versus Javadoc tags. Where the Javadoc tag goes.

How to use Javadoc to document your classes-Dummies?

All you have to do is add a comment for each public class, field, and method; then run the source files through the javadoc command; voilá! you have professional-looking, web-based documentation for your classes. The basic rule for creating JavaDoc comments is that they begin with /** and end with */.

What should be included in a Javadoc comment?

A JavaDoc comment can include text that describes the class, field, or method. Each subsequent line of a multiline JavaDoc comment usually begins with an asterisk. JavaDoc ignores this asterisk and any white space between it and the first word on the line.

What should the blank line be in Javadoc?

There should be one blank line between the Javadoc text and the first @param or @return. This aids readability in source code. The @param and @return should be treated as phrases rather than complete sentences.