Wątek przeniesiony 2016-05-24 09:33 z Java przez bogdans.

zapis do pliku

0

Chciałbym zapisywać imie oraz liczbe lat podawanych przez uzytkownika, ale jak np. używam FileWriter to nadpisuje mi ten wczesniejszy plik ktory stworzylem.

1
FileWriter fw = new FileWriter("filename", true);

Z dokumentacji:

public FileWriter(File file,
boolean append)
throws IOException
Constructs a FileWriter object given a File object. If the second argument is true, then bytes will be written to the end of the file rather than the beginning.

1 użytkowników online, w tym zalogowanych: 0, gości: 1