answer action

Can’t find an answer?

Make use of a qualified tutor to get the answer

Rhainrain
0
Q:

Kotlin : how to write a function in kotlin

Features

Kotlin
// 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
}
0
Your Answer

New to Communities?

Join the community