package com.company
import java.util.Scanner
fun main() {
val reader = Scanner(System.`in`)
print("Enter your point: ")
val userInput:Double = reader.nextDouble()
println("You entered: $userInput")
}
This is my source code
Exception in thread "main" java.util.InputMismatchException
at java.base/java.util.Scanner.throwFor(Scanner.java:947)
at java.base/java.util.Scanner.next(Scanner.java:1602)
at java.base/java.util.Scanner.nextDouble(Scanner.java:2573)
at com.company.MainKt.main(Main.kt:8)
at com.company.MainKt.main(Main.kt)
I get this error when I run my source code
Mybe you entered a value that is not a number.
Consider cheching you input value.