![]() ![]() ![]() You can mix named and unnamed arguments but have to call the unnamed parameters first. Specifying parameter names when calling a function : Kotlin allows explicitly to name the parameter when calling a function.Default values for parameters : like PHP, Kotlin supports default values for parameters in order to make some of them optional, for example.Functions that return nothing have to return “Unit” (Exception: functions without brackets). “ Unit “ type : correspondents to “void” in Java.They can be nullable by assigning a question mark to its typeįun avg ( a : Double, b : Double ) = ( a + b ) / 2 is : whether a variable is a certain type. ![]() Syntax is simiar, is also usable as expressions ( as for if/else )
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |