You might want to use this interface on many different classes, cars among them but also for clothes, food, electronics and moore. It would be inconvenient to make all these objects derive from a single class. Furthermore, each different type of item is likely to have a different means of calculating the tariff. Therefore you define an Import interface and declare that each class implements Import . The syntax is simple.
Import is declared public so that it can be accessed from any class.
It is also possible to declare that an interface is protected so that it can only be implemented by classes in a particular package. However this is very unusual. Almost all interfaces will be public. No interface may be private because the whole purpose of an Interface is to be inherited by other classes. The interface keyword takes the place of the class keyword.