val dividend = 10 val divisor = 3 val (quotient, remainder) = divide(dividend, divisor)
print("$dividend / $divisor = $quotient r $remainder")
The preceding code is going to print the following output:
10 / 3 = 3 r 1
Thanks to the fact that we are returning a data class instance, the DivisionResult class, we can benefit from the destructuring feature and assign the result to a set of separate variables.