I am new to Java. I tried running the following application in Netbeans 7.
import java.io.*; import java.nio.file.*; import java.nio.file.StrandardOpenOption.*; public class FileOut { public static void main(String[] args) { Path file = Paths.get("C:\\Java\\Chapter.13\\Grades.txt"); String s = "ABCDF"; byte[] data = s.getBytes(); OutputStream output = null; try { output = new BufferedOutputStream(file.newOutputStream(CREATE)); output.write(data); output.flush(); output.close(); } catch (Exception e) { System.out.println("Message: " + e); } } }
and when I compile the application, I get the following error message:
package java.nio.file does not exist import java.nio.file.*;
An error is displayed on both of these lines.
import java.nio.file.*; import java.nio.file.StrandardOpenOption.*;
What do I need to do to make this work? I would appreciate any help.
Thanks Joe
source share