kotlin.jvm.Throws.<init>

<init>

Throws(vararg exceptionClasses: KClass<out Throwable>)

Platform and version requirements: JVM

This annotation indicates what exceptions should be declared by a function when compiled to a JVM method.

Example:

@Throws(IOException::class)
fun readFile(name: String): String {...}

will be translated to

String readFile(String name) throws IOException {...}

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.jvm/-throws/-init-.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部