Anonymous user
Function prototype: Difference between revisions
→{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details
(Added C#) |
(→{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details) |
||
Line 623:
fun ooo(o: Int = 1): Int // optional argument with default value and return type Int
fun roo(): Int // no arguments with return type Int
val poo
}
abstract class MyAbstractClass {
abstract fun afoo() // abstract member function, no arguments or return type
abstract var apoo: Int // abstract read/write member property of type Int
Line 634 ⟶ 633:
class Derived : MyAbstractClass(), MyInterface {
override fun afoo() {}
override var apoo:
override fun foo() {}
override fun goo(i: Int, j: Int) {}
override fun voo(vararg v: Int) {}
override fun ooo(o: Int): Int = o // can't specify default argument again here but same as in interface
override fun roo(): Int = 2
override val poo
}
fun main(args: Array<String>) {
|