4 Functions
A function is a reusable portion of code that accomplishes a specific task. Functions are a very important part of programming. In fact, programs are fundamentally a series of functions combined to accomplish more complex tasks.
You have worked with some functions already, like the println function, which is provided by the Kotlin standard library for printing data to the console. You can also define your own functions in code that you write. Some functions take in data required to perform a specific task. Some functions also return data, generating output that can be used elsewhere after the function has performed its task.
To get your function feet wet, you will start by using functions to organize bounty-board’s ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access