Compiler throws InputMismatchException when string is assigned to double
I am writing a program where I need to check if a string (name) contains any whitespaces or not. Here’s part of my program : public static void main() { Scanner sc = new Scanner(System.in) ; String name = "" ; boolean error = false ; do { if(error) System.out.println("Sorry, error. Try again") ; error… Read More Compiler throws InputMismatchException when string is assigned to double