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 : Int // read only property of type Int
}
}
 
abstract class MyAbstractClass {
protected constructor()
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: Int = 0
 
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 : Int = 3
}
 
fun main(args: Array<String>) {