Why does this Kotlin method have enclosing backticks?

前端 未结 5 1984
感情败类
感情败类 2020-11-27 06:16

What are the backticks used for in the snippet below?

Why add them around the fun is(amount:Int ):Boolean { ... }?

verifier.`is`(amount         


        
5条回答
  •  感情败类
    2020-11-27 06:42

    It allows you to call a Java method whose name is a Kotlin keyword. It won't work if you leave out the backticks.

提交回复
热议问题