import java.io.*;
class Abc
{
public static void main(String arg[])
{
try{
File f= new File("c:/xyz.txt");
FileOutputStream fout=new FileOutputStream(f);
byte data[]={65,66,67,68};
fout.write(data);
fout.close();}
catch(Exception e)
{
System.out.println(e);
}
}
}
manveet
0
Newbie Poster
Recommended Answers
Jump to PostYou're missing an import statement for FileOutputStream, other than that, I can't spot any errors with this code. I think you'll have to explain a bit more about when you get this error. In what context are you using it?
Jump to PostA mistake by di2daer.
You're missing an import statement for FileOutputStream.
When we use java.io.*; It means any class/interface of java.io package can be used in our program file without qualify …
All 5 Replies
di2daer
12
Junior Poster in Training
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
kvprajapati
1,826
Posting Genius
Team Colleague
di2daer
12
Junior Poster in Training
kvprajapati
1,826
Posting Genius
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.