Via interfaces, one can specify what a class must do, but not how it should do it. An interface is just like a class and is defined in almost same way.
access interface_name { return_type method_name1(parameter_list); return_type method_name2(parameter_list); type final_var_name = value; }When no access specifier is given, access is understood to be default. Default access restricts the use of interface to the current package only.