WCM Forum

WCM Forum (http://www.wcm.at/forum/index.php)
-   Programmierung (http://www.wcm.at/forum/forumdisplay.php?f=17)
-   -   Java Output File (http://www.wcm.at/forum/showthread.php?t=96150)

Bizeps 06.05.2003 18:56

Java Output File
 
Wie kann ich in Java ein neues File erzeugen und Strings hinein schreiben?

Thankx

Bizeps 06.05.2003 20:07

bzw. wieso tut sich da nichts?


import java.io.*;
import java.util.*;

public class Clubdaten
{
public static void main(String args[]) throws Exception
{
File aFile;
FileOutputStream outputStream;
PrintStream aPrintStream;

aFile = new File("Clubdaten.txt");
outputStream = new FileOutputStream(aFile);
aPrintStream = new PrintStream(outputStream);
aPrintStream.println("Flintstone, Fred");
aPrintStream.close( );

}
}

Tarjan 06.05.2003 20:47

An und für sich gehört es genauso gemacht und müsste auch so funktionieren was ich so beim drüberlesen sehe.

Bekommst du eine Exception?

Bizeps 06.05.2003 21:41

Nein gar nichts.Keine Fehler!!!Aber Datei wird auch keine erstellt!!??


Alle Zeitangaben in WEZ +2. Es ist jetzt 18:34 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© 2009 FSL Verlag