Call an object method: Difference between revisions
m
→{{header|Kotlin}}: changed syntax highlight to kotlin
(Replace println() with print(); replace output "syntaxhighlight" tag with "pre" tag) |
m (→{{header|Kotlin}}: changed syntax highlight to kotlin) |
||
Line 811:
masskg(x) = x.weight
=={{header|Kotlin}}==
Kotlin does not have static methods
<syntaxhighlight lang="
fun instanceMethod(s: String) = println(s)
Line 820 ⟶ 821:
}
fun main(
val mc = MyClass()
mc.instanceMethod("Hello instance world!")
Line 831 ⟶ 832:
Hello static world!
</pre>
=={{header|Latitude}}==
|