Created
June 12, 2023 11:12
-
-
Save kalaiselvan369/c80a6a9c94604ef0fa807499804de973 to your computer and use it in GitHub Desktop.
Named and default arguments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
// we use parameter name while passing arguments to a function. | |
loadNextPage(page = 1, itemsPerPage = 10) | |
} | |
// itemsPerPage parameter by default has its value as 20 | |
fun loadNextPage(page: Int, itemsPerPage: Int = 20) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment