Java Interface Inheritance:

A class implements interface but one interface extends another interface.

Example

interface Simple
{
void display();
}
interface Simple1 extends Simple
{
void show();
}
class Demo implements Simple1
{
public void display()
{
System.out.println("JavaRace");
}
public void show()
{
System.out.println("Welcome to JavaRace");
}
}
class TestInterface
{
public static void main(String args[])
{
Demo d = new Demo();
d.display();
d.show();
}
}

Output

JavaRace
Welcome to JavaRace

Our Services:

Java Training | Python Training | Machine Learning with Python Training | Deep Learning with Python Training | Data Science with Python Training | Projects

Silansoftware Pvt.Ltd, BBSR
Call to: 0674-2361252

Comment