Skip to main content
**More Information**
  • This is the 14th post in a multi-part series.
    If you want to read more, see our series index

The backtick in Kotlin is meant to allow Kotlin to use keywords or, since Kotlin is meant to interop with Java, allow Kotlin to call Java functions that might conflict with Kotlin; for example, this won’t work

val class = "school" println(class)

If we wrap class in backticks (as it is a keyword) then it works just fine:

val \`class\` = "school" println(\`class\`)

This is nice… however it can be used for function names too, for example with tests we might use underscores to make the name verbose:

fun should_return_true_for_values_of_one() {

however…

fun \`should return true for values of one\`() {

Yes! That is a function name with REAL SPACES in it! AWESOME!