thanassis.com
home
blog
Online Games
Sudoku
Ivory Tower
Web Hangman
Software
Java
Object Oriented
Mobiles / J2ME
Research
C.S. Resources
Galleries
Greece
Music
Photography
Art
Personal
About me
Useful Links
Contact
Site
Downloads
My other sites
Thanassis.gr
Djangopedia
Kilogames
Xoocle
TrainJava
GameAnatomy
Latest News
Example 2 :Write a String to a File
import java.io.*;
public class WriteString {
public static void main(String args[]) {
String myString;
DataOutputStream myStream;
myString = "A Java String";
try {
myStream = new DataOutputStream(new FileOutputStream("c:\\temp.dat"));
myStream.writeChars(myString);
myStream.close();
}
catch (Exception e) {
System.out.println("Error while writing to file");
}
} //end static main
} // end WriteString class
Previous slide
Next slide
Back to first slide
View graphic version
Web
this site
Thanassis Blog News
In the News
Deep impact smashes comet
3 Florida shark attacks in a week
Mad Cow
summit in Scotland
Search the Archives