Important points for Java interface

anandsingh8

Anand Singh

Posted on September 21, 2020

Important points for Java interface

interface I1
{
public void show();
//interface tells the class what to do
}
class Test implements I1
//for interface use implements keyword
{
public void show()
//It is necessary to create body of abstract method in child class
{
System.out.println("1");
}

public static void main(String[] args)
{
//We cannot create an object of interface so we have created the object of test class here
Test t=new Test();
t.show();

}
}

💖 💪 🙅 🚩
anandsingh8
Anand Singh

Posted on September 21, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Important points for Java interface
java Important points for Java interface

September 21, 2020