hello all! I am very beginner in java and learning File handling. I got some error in the program given below:
import java.io.*;
public class FileOutputStream {
public static void main(String[] args) throws IOException {
//set up file and stream
File outFile = new File("sample1.data");
FileOutputStream outStream = FileOutputStream(outFile); //Error:The constructor FileInputStream(File) is undefined
//data to output
byte[]byteArray = {10, 20, 30, 40, 50, 60, 70, 80};
//write data to the stream
outStream.write(byteArray); //Error: Create a Method read
//output done, so close the stream
outStream.close(); /Er/ror: Create a Method close
}
}
This program is taken from some book but still error. can anyone explain the error??
Thanks
Ranjeet