Comments

Comments can be used to explain code, make code more readable or to prevent execution.
There are three types of comments:

  • single line - starts from //
  • multi-line - starts from /* and end by */
  • java doc - starts from /** and end by */, inside you can use javadoc annotations
// single line comment
int i = 0;

//----------------------------------------------------------
// making comments to separate code sections

/*
multi-line
comments
*/

/**
* Javadoc example.
* This is strange method, that return "foo " + parameter
* using {@link java.lang.String#valueOf(int) String.valueOf}.
*
* @param b - parameter of method
* @return some string
*
* @see java.lang.string
* @author Harry Potter
*/
String foo(int b){
  return "foo: " + String.valueOf(b); 
}