package tiedosto; import java.io.*; /** * Ohjelmalla tulostetaan kertotaulu tiedostoon. Jos tiedosto on * olemassa, jatketaan vanhan tiedoston per��n. * @author Vesa Lappalainen * @version 1.0, 21.02.2003 */ public class KertotauluWriter { /** * Kertotaulu tiedostoon * @param args ei k�yt�ss� */ @SuppressWarnings("resource") public static void main(String[] args) { PrintWriter fo = null; try { fo = new PrintWriter(new FileWriter("taulu.txt", true)); } catch (IOException ex) { System.err.println("Tiedosto ei aukea: " + ex.getMessage()); return; } int kerroin = 5; try { for (int i = 0; i < 10; i++) fo.println(i + "*" + kerroin + " = " + i * kerroin); } finally { fo.close(); } } }