Hi everybody,
I have Eclipse 3.6.0 installed on Window XP. Also there a sample file in C:\ called sample.txt
The file is empty.
Please give a code that opens this particular file and write a short word "Hello".
Thanks!
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hi everybody,
I have Eclipse 3.6.0 installed on Window XP. Also there a sample file in C:\ called sample.txt
The file is empty.
Please give a code that opens this particular file and write a short word "Hello".
Thanks!
Googling for Java File Input/Output is a good way to go. May i suggest checking out the forum rules. Announcements - What's Wrong With My Code?
Lesson: Basic I/O (The Java™ Tutorials > Essential Classes)
Chris
An exmaple of opening a file is given on this page Buffered Streams (The Java™ Tutorials > Essential Classes > Basic I/O)
If you wish to program you need to learn to use APIs they are your friend. On that page a few different classes are mentioned, if you take the time to read the API for them, and the documentation example pages for thos classes, you will learn alot and be opening files in no time at all
Chris
Can I suggest following some basic tutorials on Java,
You seem to be missing all of the core concepts of programming in Java. I don't wish to be rude, but you do require to study some more before we can provide a sensible level of hope.
Regards,
Chris