Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void creaFile() {
- try {
- file = new FileOutputStream ("prova.txt");
- } catch (FileNotFoundException e) {
- System.out.println("Errore nella creazione del file");
- }
- try {
- fw = new FileWriter("prova.txt");
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- bf = new BufferedWriter(fw);
- }
- public void scriviSuFile(Dipendente d) {
- try {
- bf.write(d.getId());
- bf.flush();
- } catch (IOException e) {
- System.out.println("Errore nella scrittura");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement