46.interface inheritance

//interface inheritance


interface base 

{

void test();

}

interface derived extends base 

{

void show();

}

class message implements derived

{

public void test()

{

System.out.println("This is test method of interface base");

}

public void show()

{

System.out.println("This is show method of interface derived");

}

}

class intf_inh

{

public static void main(String[] args) {

message obj = new message();


obj.test();

obj.show();

}

OUTPUT:

This is test method of interface base

This is show method of interface derived


Comments