Kotlin -- 一文详解Kotlin文档

时间:2025-02-08 14:21:38
/** * @constructor 构建一个Kdoc测试类 * @author opLW * @date 2020/2/7 * @since 0.0.1 */ class LabelTest() { /** * [我是一个链接][] * * `我是代码段` * * [我是超链接]() * * @param i 传进来的参数为i * @see * @sample * @throws MyException 当i小于0时抛出异常 * @exception MyException 当i小于0时抛出异常 * @return 返回值为整型 */ fun testFun(i: Int): Int { if (i < 0) { throw MyException("The value of i is smaller than 0") } return i } inner class MyException(errorMsg: String): Exception(errorMsg) } /** * @receiver [] 我是一个扩展函数 */ fun LabelTest.extentsion() { }