I tried read from file double values and using Scanner
with this aim.
It throws InputMismatchException :
\"input.txt\" java.util.InputM
Use the correct delimiter to parse your input (\n
= newline)
String filename = "input.txt";
Scanner in = new Scanner(filename).useDelimiter("\\n");
double largest;
if (in.hasNextDouble())
largest = in.nextDouble();
while (in.hasNextDouble())
{
double input = in.nextDouble();
if (input > largest)
{
largest = input;
}
}