Named & Default Arguments

You can specify argument names when calling a function.

Named arguments are useful for code readability, and this is especially true for long and complex argument lists—named arguments can be clear enough that the reader doesn’t need to check the documentation. If the function has primitive argument types like Int or Boolean, named arguments help clarify their meaning:

End of sample. See AtomicKotlin.com for full early-access book.



Previous          Next

©2018 Mindview LLC. All Rights Reserved.