# Extending Interfaces

![](/files/-LUncCfCYs7B_Tr46iVv)

![](/files/-LUncMKLAAUYczNwTfJ_)

By extending interfaces, you can combine methods of multiple interfaces. In the previous example, the interface FamilyPGHouse combines the methods of the interfaces ChildFriendly, PayingGuestHouse, and GuestHouse. When a class implements an interface, it should implement all the methods defined in the interface and its base interfaces, unless it’s declared as abstract. If, for example, a class implements the interface PayingGuestHouse, that class must implement method paidBreakfast() defined in the interface PayingGuestHouse, and method welcome() defined in the interface GuestHouse.

![](/files/-LUncXbBhzwRx_Hz6wZu)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gyansetu-java.gitbook.io/core-java/interfaces/extending-interfaces.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
