some one could explain why this don wanna run.
Code: import java.util.Scanner; class Comparison { public static void main(String[] args) { Scanner z = new Scanner(System.in); Scanner x = new Scanner(System.in); Scanner y = new Scanner(System.in); System.out.println(" Maximum number you input: "); System.out.println(max1(z.nextDouble(),x.nextDouble(),y.nextDouble())); System.out.println(" Minimum number you input: "); System.out.println(min2(z.nextDouble(),x.nextDouble(),y.nextDouble())); } static double max1(double x, double y, double z){ if (x>y && x>z){ return x; } else if (y>z){ return y; } else { return z; } } static double min2(double x, double y, double z){ if (x<y && x<z){ return x; } else if (y<z){ return y; } else { return z; } } } output: Exception in thread "main" java.util.NoSuchElementException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextDouble(Unknown Source) at Comparison.main(Comparison.java:9)