Kotlin (programming language): Difference between revisions

Content deleted Content added
No edit summary
Remove incorrect information that Kotlin was different from Java and Scala in terms of virtual functions/dispatch. See https://kotlinlang.org/docs/comparison-to-java.html
Line 130:
* all classes are public and final (non-inheritable) by default
* functions and methods support [[default argument]]s, [[variadic function|variable-length argument]] lists and [[Named parameter|named argument]]s
 
Contrary to Java and Scala, in Kotlin class member functions are virtual, i.e. dispatched based on the runtime type of the object they are called on.
 
Kotlin 1.3 added support for contracts,<ref>{{Cite web|url=https://kotlinlang.org/docs/reference/whatsnew13.html|title=What's New in Kotlin 1.3 - Kotlin Programming Language|website=Kotlin|access-date=4 April 2020|archive-date=22 August 2023|archive-url=https://web.archive.org/web/20230822164600/https://kotlinlang.org/docs/reference/whatsnew13.html|url-status=live}}</ref> which are stable for the standard library declarations, but still experimental for user-defined declarations. Contracts are inspired by [[Eiffel (programming language)|Eiffel's]] [[design by contract]]<ref>{{Cite web|url=https://discuss.kotlinlang.org/t/design-by-contract-dbc-design-considerations/1321|title=Design by Contract (DbC) design considerations|quote=Implement the full semantics of Eiffel DbC and improve upon it.|date=16 August 2012|website=Kotlin Discussions|language=en-US|access-date=4 April 2020|archive-date=5 April 2023|archive-url=https://web.archive.org/web/20230405081654/https://discuss.kotlinlang.org/t/design-by-contract-dbc-design-considerations/1321|url-status=live}}</ref> programming paradigm.