Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8821551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:53:02+00:00 2026-06-14T05:53:02+00:00

As we know, interfaces can extend interface in the Java. I have a question

  • 0

As we know, interfaces can extend interface in the Java. I have a question about this, if interface B extends interface A, B need not implement the methods defined in the A. But in the java.util package, the List interface extends Collection interface, and it implements the Collection method, these methods also just have the method declaration.

Why does it do this, and it there a better practice? Does it make any difference between implementing the method in the sub interface or not?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:53:03+00:00Added an answer on June 14, 2026 at 5:53 am

    Overriding a method, besides providing/replacing a method implementation, allows to provide a more specific javadoc, and to narrow the return type.

    For instance, Collection.iterator() is specified by:

    Returns an iterator over the elements in this collection. There are no
    guarantees concerning the order in which the elements are returned
    (unless this collection is an instance of some class that provides a
    guarantee).

    while List.iterator() is specified by

    Returns an iterator over the elements in this list in proper sequence.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am still not so familiar with interfaces in Java. I know that interface
From code how can we know which interfaces one class implements? Example: interface IDrink
I know with OO Perl I can have objects and inheritance, but are interfaces
I know that you can't have a constructor in an interface, but here is
As you know, OAuth can support RSA-SHA1 Signature. I have an OAuthSignature interface that
I know that an interface does not have a body, just a method definition.
Let's say I have the following Java interface that I may not modify: public
I need to implement a bag data structure using the interface java.util.Collection . I'm
So we all know that all classes implicitly extend Object. How about interfaces? Is
If a Java class implements the Serializable interface but does not have a public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.