‫Function.
‫Overloading in Kotlin allows you to define multiple functions with the same name, in the same scope,
‫but with different parameter lists.
‫The functions can have different numbers or types of parameters.
‫When you call the overloaded function the.
‫The Kotlin compiler figures out which version of the function to call based on the arguments you provide.
‫This is known as function overloading.
‫For example, I'll create a similar function to this function, but of type double function some two
‫numbers x of type double, y of type double and it's returning type will be a double.
‫In this example we have two versions of some two numbers.
‫Function.
‫The first function takes two integer parameters and return an integer.
‫The second version of the function takes two double parameters and returns a double.
‫So here I'll copy the function body.
‫These functions have the same name, some two numbers, but they differ in the types of parameters and
‫the return type.
‫Let me show you.
‫If I call the function some two numbers and I pass five and three, which are integers, the first version
‫of some two numbers function will be called and this depends on the integer.
‫So if I run the program, you can see that I'm calling the first version of this function.
‫If I pass 5.3 and 3.7, run the program.
‫And you can see it.
‫The returning type of it is a 99.0.
‫So I'm calling the second version of some two numbers function.
‫So if I pass double you can see some two numbers is turned into yellow and this turns into gray.
‫If I hover here function some two numbers is never used.
‫This integer function is not being used.
‫I'm using add two doubles and return a double.
‫This is the function overloading in Kotlin.