Anand Singh
Posted on September 21, 2020
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();
}
}
💖 💪 🙅 🚩
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.