It is possible to declare an interface in a package.
We know that an object cant created to the interface, so we have to implement the interface in a class then we can create object for implementation class.
Let us see a program to declare an interface in the package as follows
public interface A
void display ( )
// public abstract }
public class B implements A
public void display ( )
system.out.println("duty is god");
public static void main ( string args [ ])
B obj = new B( );
Java Training | Python Training | Machine Learning with Python Training | Deep Learning with Python Training | Data Science with Python Training | Projects
SILAN Technology Call to: 9439202111 | 9658317757 | 0674-2361252