support default arguments, variable-length argument lists, named arguments 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. Kotlin 1.3 added support for contracts, which are stable for the standard library declarations, but still experimental for user-defined declarations. Contracts are inspired by Eiffel's design by contract programming paradigm. Kotlin code may be compiled to JavaScript, allowing for interoperability between code written in the two languages. This can be used either to write full web applications in Kotlin, or to share code between a Kotlin backend and a JavaScript frontend. Syntax Procedural programming style Kotlin relaxes Java's restriction of allowing static methods and variables to exist only within a class body. Static objects and functions can be defined at the top level of the package without needing a redundant class level. For compatibility with Java, Kotlin provides a JvmName annotation which specifies a class name used when the package is viewed from a Java project. For example, @file:JvmName("JavaClassName"). Main entry point As in C, C++, C#, Java, and Go, the entry point to a Kotlin program is a function named "main", which may be passed an array containing any command-line arguments. This is optional since Kotlin 1.3. Perl, PHP and Unix shell style string interpolation is supported. Type inference is also supported. // Hello, World! example fun main() { val scope = "World" println("Hello, $scope!") } fun main(args: Array<String>) { for (arg in args) println(arg) } Extension functions Similar to C#, Kotlin allows adding an extension function to any class without the formalities of creating a derived class with new functions. An extension function has access to all the public interface of a class, which it can use to create a new function interface to a target class. An extension function will appear exactly like a function of the class and will be shown in code completion inspection of class functions. For example: package MyStringExtensions fun String.lastChar(): Char = get(length - 1) >>> println("Kotlin".lastChar()) By placing the preceding code in the top-level of a package, the String class is extended to include a function that was not included in the original definition of the String class. // Overloading '+' operator using an extension function operator fun Point.plus(other: Point): Point { return Point(x + other.x, y + other.y) } >>> val p1 = Point(10, 20) >>> val p2