Default and named parameters

Do you ever end up writing multiple method overloads to achieve something, just because an existing function requires one extra parameter just to reuse an existing function's logic? Or ever double-check whether the parameter you have passed in a function is binding with a desired method's parameter or not? Yes, Kotlin can solve this problem with default and named parameters.

Get Kotlin Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.