Jun 7, 2017

[HDGEM] How to solve kotlin system.in error: expecting an element

val sc = Scanner(System.in)

 in is a keyword and the compiler complains with "expecting property name or receiver type" and "expecting an element".
The following should work:
val sc = Scanner(System.`in`)


--
Posted By Blogger to HDGEM at 6/07/2017 06:39:00 AM