Ich habe das Bereit gemacht und es soll nur der Farbe „Gelb“ sein, aber es kommt immer eine Fehlermeldung...
Code:
package helloworld;
public class Car {
//Eigenschaften/Attribute
private String color; //Farbe
private String brand; //Marke
private int horsePower; //PS-Zahl
//Methoden
public void drive() {
System.out.println("Das Auto fährt");
}
//Getters und Setters -> color
public String getColor() {
return color;
}
public void setColor(String color) {
if(setColor equals("Gelb") ) {
}
this.color = color;
}
}