Content deleted Content added
→Semantics: main function is the entry point of the application |
→Semantics: additional statements regarding optional semi-colons. |
||
Line 32:
== Semantics ==
Like [[Pascal programming language|Pascal]] and [[Scala (programming language)|Scala]], Kotlin [[Variable (computer science)|variable]] declarations and [[Parameter (computer_programming) |parameter lists]] have the [[data type]] come after the variable name (and with a [[Colon_(punctuation)|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]], [[Semicolon|semicolons]] are optional as a [[Statement (computer science)|statement]] [[Statement_terminator#Statements|terminator]], in most cases a [[newline]] is sufficient for the [[compiler]] to deduce that the statement has ended.<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]]
'''Hello, world! example'''
|