“Função de Kotlin” Respostas de código

Como escrever uma função em 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
}
Noob_Code

Função de Kotlin

fun main(args: Array<String>) {

    var number = 5.5
    print("Result = ${Math.sqrt(number)}")
}
SAMER SAEID

Kotlin como chamar uma função?

callme()
SAMER SAEID

Programa de função simples de Kotlin

fun callMe() {
    println("Printing from callMe() function.")
    println("This is cool (still printing from inside).")
}

fun main(args: Array<String>) {
    callMe()
    println("Printing outside from callMe() function.")
}
SAMER SAEID

Função em Kotlin

kotlin function
Nasty Newt

Respostas semelhantes a “Função de Kotlin”

Procure respostas de código populares por idioma

Procurar outros idiomas de código