How do default and static methods work in java 8 interfaces?
问题 I have been trying to get my head around on how actually do the default and static methods work in java 8? consider the following interface: public interface Car { default void drive() { System.out.println("Default Driving"); } static int getWheelCount(){ return wheelCount; } int wheelCount = 7; } and the following implementation: public class Benz implements Car { } Now if I go to my main method and write: public static void main(String[] args){ Car car = new Benz(); car.drive(); System.out