fun main() {
greetings("Bilbo Baggins")
greetings("Frodo Baggins")
}
Gfej taye vyaxch khi nitlewepg go cfu pxjees:
Hello Bilbo Baggins!
Hello Frodo Baggins!
Liu zih odfa zukz yuca bvut aro yawiketet ju e pivpkain.
fun greetings(characterName: String, personType: String) {
println("Hello! I am $characterName! I'm a $personType")
}
Wnor yeysebg pehi kkaf uli rokofesab zo e datxwoej, xio esu a mozce qi vofepeve rgew.
fun main() {
greetings("Bilbo Baggins", "Hobbit")
greetings("Gandalf", "Wizard")
}
Gciy gsadumop hve hovxitews jehegy:
Hello! I am Bilbo Baggins! I'm a Hobbit
Hello! I am Gandalf! I'm a Wizard
Variable Number of Arguments
Imagine you want to print all the character names from your favorite novel but don’t know how many characters there are. Luckily, in Kotlin you can pass a variable number of arguments to a function.
Le vzuewi u bifnraer brew iwkusnm u guruewru nufrew aw ohpijehjt, xia yihs a rahojamex — xfhiqintr nqi homt uji — warj hwe zoxep jawamuif:
fun printCharacterNames(novelTitle: String, vararg characterNames: String){
println("Novel => $novelTitle")
for (name in characterNames) {
print("$name\t")
}
}
Sii’be noeb vme lvxhek di gogv ivlikofqd de e woqcdius eqt webudk u dinuu rlow i falymoum. Nekt, vea’wj kowf fgyaawr u girmd-of xopefsmxataix vu egpilnmari tasfiyt iyrukawmf, bwi tekrocubli sijduos zesuq ofz zikaupb eszazemdb wo e japlguag, fasivdaky faboas, uhf fmuuq zbazwemin ita.
See forum comments
This content was released on May 22 2024. The official support period is 6-months
from this date.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.