class Static { public static int fellesForAlle = 3; public int ikkeFelles = 3; Static() { fellesForAlle = fellesForAlle * 2; ikkeFelles = ikkeFelles * 2; } public int hentFellesForAlle() { return fellesForAlle; } public int hentIkkeFelles() { return ikkeFelles; } } class TestStatic { public static void main(String[] args) { Static st1 = new Static(); System.out.println(st1.hentFellesForAlle()); System.out.println(st1.hentIkkeFelles()); Static st2 = new Static(); System.out.println(st1.hentFellesForAlle()); System.out.println(st2.hentIkkeFelles()); Static st3 = new Static(); System.out.println(st1.hentFellesForAlle()); Static st4 = new Static(); System.out.println(st1.hentFellesForAlle()); Static st5 = new Static(); System.out.println(st1.hentFellesForAlle()); Static st6 = new Static(); System.out.println(st1.hentFellesForAlle()); } }