Kdoc 주석: Kotlin에서 문서화에 사용되는 주석 형식
Kdoc 주석을 사용하여 코드를 문서화하는 이유?
Kdoc 주석 작성 방법:
Kdoc 주석 작성 유의할 점:
클래스 문서화 Kdoc 주석 예
/**
* This is a class that represents a person
* @property name The person's name
* @property age The person's age
*/
class Person(val name: String, val age: Int){
//class Implementation
}
/**
* This is a function that adds two integers
* @property a The first integer
* @property b The second integer
* @return The sum of teo integers
*/
fun add(a:Int, b:Int):Int{
return a+b
}
/**
* This is a variable that represents the maximum value
*/
val MAX_VALUE = 100
/**
* This is a enum class that represents a color
* @property colorCode The code of the color
*/
enum class Color(val colorCode: Int){
RED(0xFF0000),
GREEN(0x00FF00),
BLUE(0x0000FF)
}
/**
* This is a Kotlin file that contains some utility functions
*/
package com.example.utils