Skip to content
Advertisement

here we know that deque is an interface and queue is also an interface so deque should implement queue but here it is extending it?

enter image description here

https://www.javatpoint.com/collections-in-java#:~:text=The%20Collection%20in%20Java%20is%20a%20framework%20that,Java%20Collection%20means%20a%20single%20unit%20of%20objects.

Advertisement

Answer

A class implements an interface. An interface may extend from another interface, but cannot implement.

Implementing means providing the content, the state and behavior, of a class as required to meet the contract defined in the interface. An interface has neither state nor behavior, only method signatures. (We are ignoring default methods on an interface as they are but a hack needed for lambdas/streams support.)

➥ Study the tutorial on interfaces provided free of cost by Oracle.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement