simple file output question thanks in advance
ok so i wrote a program that reads from a file and outputs to a file. thing is the input file has several numbers and the output file is just printing the last answer(overwriting the others)
the program takes a number ex"683" finds the largest and smallest digit in the number then calculates its range
below is the part that prints to the output
public static void main(String args[]) throws FileNotFoundException
{
Scanner input = new Scanner (new File (args[0]));
while(input.hasNextInt())
{
int num = input.nextInt();
int range = digitRange(num);
PrintStream output = new PrintStream(new File("digit-range.out"));
output.print("The digit range of" + "\"" + num + "\"" + " is " + range);
}
}
any suggestions?