I am reading user input using scanner class, when I write code then there is ' ' marks appears around .in, i try to search about it but not found what its name and use of it can you guys tell me more about this.
my code
fun main(args:Array<String>)
{
var input = Scanner(System.'in')
println("Enter input : ")
var userInput = input.nextInt()
println("You entered : $userInput")
}
why code only works when I add '' marks around in otherwise it not work. I got error message
Kotlin: Expecting an element
in
is a reserved keyword in Kotlin, so you need to escape it with backticks (example: `in` ) in order for it to work. Single quotes (example: 'in') are used for character literals, not string literals, so backticks are required.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With