Skip to content

Instantly share code, notes, and snippets.

@kalaiselvan369
Created June 12, 2023 11:12
Show Gist options
  • Save kalaiselvan369/c80a6a9c94604ef0fa807499804de973 to your computer and use it in GitHub Desktop.
Save kalaiselvan369/c80a6a9c94604ef0fa807499804de973 to your computer and use it in GitHub Desktop.
Named and default arguments
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