i have the following code: ```fun getCoffee(cups:I...
# announcements
a
i have the following code:
Copy code
fun getCoffee(cups:Int):String{
    if (cups<4){
        return "Okay"
    }
    else {
        throw Exception("Too much coffee!")
    }
}
Since there is no
throws Exception
notation in kotlin, does that mean their is no way for caller function to know before hand? I wrote the following driver code, and there were no Lint warnings and it was getting compiled without any problems:
Copy code
fun main(args:Array<String>){
    for (i in 1..6) {
        println(getCoffee(i))
    }
}
j
Check out the
@Throws
annotation
s

https://youtu.be/pvYAQNT4o0I