Skip to content

Instantly share code, notes, and snippets.

@PatilShreyas

PatilShreyas/DefaultArgs.kt Secret

Created Dec 21, 2020
Embed
What would you like to do?
fun startSomething(something: Something, config: SomeConfig = DefaultSomeConfig()) {
// Do something
}
fun main() {
// Start something with default Config
startSomething(something)
// Start something with customized Config
someConfig = getSomeConfig()
startSomething(something, someConfig)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment