Kotlin (programming language): Difference between revisions

Content deleted Content added
Design: WP:UNDUE: why highlight Scala for widespread language features?
Design: extensive support for both object-oriented and functional programming is another big similarity with Scala
Line 129:
* there is a distinction between [[Immutable object|mutable and immutable]] variables (''var'' vs ''val'' keyword), and
* all classes are public and final (non-inheritable) by default.
In* additionthere tois theextensive [[classsupport (computerfor programming)|classes]] and [[Method (computer programming)|member functions]] (which are equivalent to methods) ofboth object-oriented programming,and Kotlin also supports [[proceduralfunctional programming]] with the use of [[function (computer science)|functions]].<ref>{{cite web |url=https://confluence.jetbrains.com/display/Kotlin/Functions |title=functions |website=jetbrains.com |access-date=8 February 2014 |archive-date=23 November 2015 |archive-url=https://web.archive.org/web/20151123112725/https://confluence.jetbrains.com/display/Kotlin/Functions |url-status=live}}</ref>
 
In addition to the [[class (computer programming)|classes]] and [[Method (computer programming)|member functions]] (which are equivalent to methods) of object-oriented programming, Kotlin also supports [[procedural programming]] with the use of [[function (computer science)|functions]].<ref>{{cite web |url=https://confluence.jetbrains.com/display/Kotlin/Functions |title=functions |website=jetbrains.com |access-date=8 February 2014 |archive-date=23 November 2015 |archive-url=https://web.archive.org/web/20151123112725/https://confluence.jetbrains.com/display/Kotlin/Functions |url-status=live}}</ref>
Kotlin functions and constructors support [[default argument]]s, [[variadic function|variable-length argument]] lists, [[Named parameter|named argument]]s, and overloading by unique signature. Class member functions are virtual, i.e. dispatched based on the runtime type of the object they are called on.