Interface inheritance

Java Programming Language Abstarct class and Methods in java (Article) Abstarct class and Methods in java (Program)

1340

Program:


interface Grandpa{
void Gname();
}
interface Dad extends Grandpa{
void Dname();
}
class Son implements Dad{
public void Gname(){
	System.out.println("Grandpa's Name");
	}
public void Dname(){
	System.out.println("Dad's Name");
	}

public static void main(String args[]){
Son obj = new Son();
obj.Gname();
obj.Dname();
 }
}

Output:

Grandpa's Name
Dad's Name
Press any key to continue . . .

This Particular section is dedicated to Programs only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.