January 2018
Intermediate to advanced
434 pages
14h 1m
English
In the following steps, we will learn how to use polymorphism in Kotlin:
fun main(args: Array<String>) { println(doubleOf(4)) println(doubleOf(4.3)) println(doubleOf(4.323))}fun doubleOf(a: Int): Int { return 2*a}fun doubleOf(a: Float): Float { return 2*a}fun doubleOf(a: Double): Double { return 2.00*a}
Here's the output of the preceding code:
88.68.646
Read now
Unlock full access