Help with FileNotFoundException
I'm learning Java from a book, and I'm sure I copied everything exactly, but if I use the example code from the book, it has errors. Maybe outdated? Please check the code.
Code:
throws FileNotFoundException {
Scanner diskScanner = new Scanner(new File("rawData.txt"));
PrintStream diskWriter = new PrintStream("cookedData.txt");
double unitPrice, quantity, total;
unitPrice = diskScanner.nextDouble();
quantity = diskScanner.nextInt();
total = unitPrice * quantity;
diskWriter.println(total);
}
I imported java.io.File, java.io.FileNotFoundException, java.io.PrintStream