public class BankkontoMain { public static void main(String[] args) { Bankkonto bankkonto = new Bankkonto(); Thread t1 = new Thread(new SettInnTråd(bankkonto)); Thread t2 = new Thread(new SettInnTråd(bankkonto)); Thread taUt = new Thread(new TaUtTråd(bankkonto)); t1.start(); t2.start(); taUt.start(); //Main-tråden sover litt i 2 sekunder, så vi kan se sluttsaldo try { Thread.sleep(2000); } catch (InterruptedException e) { } System.out.println("Saldo til slutt: "+bankkonto.saldo); } }