Kotlin (programming language): Difference between revisions

Content deleted Content added
Semantics: functions reference
Semantics: main function is the entry point of the application
Line 32:
 
== Semantics ==
Like [[Pascal programming language|Pascal]] and [[Scala (programming language)|Scala]], Kotlin variable declarations and parameter lists have the [[data type]] come after the variable name (and with a colon separator), unlike [[C language|C]] and its derivatives such as C++, Java, C#, and D. As in other modern languages like Scala and [[Groovy (programming language)|Groovy]], semicolons are optional in most cases.<ref>{{cite web | url=http://confluence.jetbrains.com/display/Kotlin/Grammar#Grammar-Semicolons | title=Semicolons | website=jetbrains.com | accessdate=February 8, 2014}}</ref> In additional to the [[Class (computer programming) | classes]] and [[Method_(computer_programming) | methods]] (called member functions in Kotlin) of [[object-oriented programming]] , Kotlin also supports [[procedural programming]] with the use of [[function (computer science) | functions]]. <ref>{{cite web | url=http://confluence.jetbrains.com/display/Kotlin/Functions | title=functions | website=jetbrains.com | accessdate=February 8, 2014}}</ref> As in C and C++, the [[entry point]] to a Kotlin [[Computer_program | program]] is a function named "main", which is passed an array containing any [[Command-line_interface|command line]] [[Parameter (computer_programming) |arguments]].
 
'''Hello, world! example'''