Skip to content
Snippets Groups Projects
Commit acda22f7 authored by aichinos's avatar aichinos
Browse files

ongelma löytyigit add --all!

parent f51bed84
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@ public class Kurssit {
private int kpl = 0;
private static String tiedostonNimi = "tiedot";
private static final int MAX_KPL = 5;//montako kurssia yhdelle taulukolle
private static final int MAX_KPL = 10;//montako kurssia yhdelle taulukolle
/**
......@@ -101,7 +101,7 @@ public class Kurssit {
public void tallenna(String hakemisto) throws SailoException{
//TODO: hakemiston luominen tähän
File ftied = new File(hakemisto + "/kurssit.dat");
try (PrintStream fileOut = new PrintStream(new FileOutputStream(ftied, true))){
try (PrintStream fileOut = new PrintStream(new FileOutputStream(ftied, false))){
// true = uusi text appendoidaan vanhan tekstin perälle
for(int i=0; i<this.getKpl(); i++) {
Kurssi kurssi = this.anna(i);
......@@ -145,6 +145,12 @@ public class Kurssit {
Kurssit taulukko = new Kurssit();
try {
taulukko.lueTiedostosta("tiedot");
} catch (SailoException ex) {
System.err.println(ex.getMessage());
}
Kurssi japani4 = new Kurssi();
japani4.rekisteroi();
japani4.tayta();
......@@ -155,7 +161,7 @@ public class Kurssit {
try {
taulukko.lisaa(japani4);
taulukko.lisaa(ohjelmointi2);
//taulukko.lisaa(ohjelmointi2);
//taulukko.lisaa(japani4);
//taulukko.lisaa(ohjelmointi2);
//taulukko.lisaa(japani4);
......
1|Esimerkkikurssi22|Kokko Vesa
2|Esimerkkikurssi79|Kokko Vesa
1|Esimerkkikurssi22|Kokko Vesa
22|Esimerkkikurssi79|Kanta Natalia
34|Esimerkkikurssi22|Tanaka Sari
35|Esimerkkikurssi79|Mies nainen
1|Esimerkkikurssi22|Kokko Vesa
36|Esimerkkikurssi80|Kokko Vesa
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment