class OpgaverEftermiddag {
    public static void main(String args[]) {
        Bil honda_95 = new Bil(1995, "Honda");
        System.out.println(honda_95);
        Bil bmw_19 = new Bil(1995, "BMW");
        System.out.println(bmw_19.getAargang() + " " + bmw_19.getMaerke());
        bmw_19.changeAargang(2024);
        honda_95.changeMaerke("Mercedes");
        Bil vw = new Bil("VW");

    }
}

class Bil {
    private int aargang;
    private String maerke;

    public Bil(int aargang, String maerke) {
        this.aargang = Math.max(aargang, 1860);
        this.maerke = maerke;
    }

    public Bil(String maerke) {
        this(2025, maerke);
    }

    public void changeAargang(int aargang) {
        this.aargang = Math.max(aargang, 1860);
    }

    public void changeMaerke(String maerke) {
        this.maerke = maerke;
    }

    public int getAargang() {
        return this.aargang;
    }

    public String getMaerke() {
        return this.maerke;
    }

    public String toString() {
        return this.maerke + " fra " + this.aargang;
    }
}