xxxxxxxxxx
public interface Vehicle {
String getBrand();
String speedUp();
String slowDown();
default String turnAlarmOn() {
return "Turning the vehice alarm on.";
}
default String turnAlarmOff() {
return "Turning the vehicle alarm off.";
}
}
xxxxxxxxxx
BACKWARD COMPATIBILITY
For example, the Collection interface does not have a forEach method declaration.