educative.io

Why can't we call default method from main method of implemented class

Interface Vehicle {
default void start() { … }
}

public class Car {

 public static void main(String args[]) {
      **Vehicle.super.start();**  // it gives error
      /*
         we can call above line from any method of this class but why can't we call it from main method
      */
 }

}

Hi @prahalad

In order to call that, we have inherit that class in this class.

Also, provide the link of the lesson if you have any further confusion.