abstract class Kjoretoy { protected String regNr; protected String merke; } class Bil extends Kjoretoy { private int antPersoner; public Bil(String r, String m, int antP){ this.regNr = r; this.merke = m; if (antP >= 2 || antP <= 5){ this.antPersoner = antP; } } } class Motorsykkel extends Kjoretoy { public Motorsykkel(String r, String m){ this.regNr = r; this.merke = m; } }