/** * Add 2 number * * @param a first value * @param b second value * @return a + b */fun add(a: Int, b: Int): Int { return a + b}
Generally, avoid using @param and @return tags. Instead, incorporate the description of parameters and return values directly into the documentation comment, and add links to parameters wherever they are mentioned. Use @param and @return only when a lengthy description is required which doesn't fit into the flow of the main text.
/** * Returns the absolute value of the given [number]. */fun abs(number: Int) { /*...*/ }
References: