In this tutorial how to create a Interface and implement in Core Java is shown.
Code:
Interface.java
interface Test
{
abstract public void disp();
}
class A
{
int a=100;
}
class Dummy extends A implements Test
{
public void disp()
{
System.out.println(“Inside Interface”);
}
}
class TestInterface
{
public static void main(String args[])
{
Dummy d=new Dummy();
d.disp();
System.out.println(“A: “+d.a);
}
}