📜  如何在 kotlin 代码示例中编写函数

📅  最后修改于: 2022-03-11 14:53:34.394000             🧑  作者: Mango

代码示例1
// Use 'fun' keyword to declare function
// 'num' is the parameter and is of type Int
// The ':Int' indicates the return type
fun square(num: Int):Int {
    return num * num
}