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

  • Home
  • SEARCH
  • 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 8308113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:42:02+00:00 2026-06-08T18:42:02+00:00

( DISCLAIMER : This is NOT a question about understanding the difference between abstract

  • 0

(DISCLAIMER: This is NOT a question about understanding the difference between abstract classes and interfaces. If you didn’t get that, please read the title again. I am well-versed in the difference between a contract and a half-implemented subsystem.)

Let’s take Java as just one example. It seems that there is little need for a distinct keyword interface, when from my point of view as a developer, the compiler spits out exactly the same thing, which in human-speak is, “You cannot utilise this until you derive (via implements or extends) a new class which implements its methods”. Simple.

But there is one scenario which may prevent conflation of these two: When we need to implement more than one interface, since Java does not allow multiple inheritance (for classes). Surely it would be trivial to build the language in such a way that the compiler recognises when there are any method bodies or declared variables, and subsequently disallows multi-implements/extends where appropriate? Does order of precedence then present a problem?

Is this the only reason we have this syntactic differentiation?

P.S. One reason I ask this question is that this scenario can present quite a challenge in understanding for new OO programmers, and I think that handling this in a more streamlined fashion, at the language level, would greatly assist in more quickly grasping the conceptual differences.

  • 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-08T18:42:05+00:00Added an answer on June 8, 2026 at 6:42 pm

    Surely it would be trivial to build the language in such a way that the compiler recognises when there are any method bodies or declared variables, and subsequently disallows multi-implements/extends where appropriate?

    Let’s say you did do that. So your language lets you do this:

    class Foo extends A, B, C {
    }
    

    And it doesn’t complain as long as every method in B and C is abstract. Fine and dandy.

    Now let’s say that you didn’t create B. It’s in some other package someone else wrote. They don’t know anything about your class Foo. When they made B, everything in it was abstract, but that was just a coincidence: they didn’t happen to have anything concrete to put in there yet.

    Later, they decide to add another method to B, which is concrete. Now, without realizing it, they’ve broken your class Foo.

    One argument for having an explicit interface construct is that it makes the intent of the author of B clear to someone consuming it.

    In general, I think your question is a good one. The language I work on, Dart, is actually close to what you’re talking about: It has an explicit interface syntax now, but it’s being removed in favor of pure abstract classes.

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

Sidebar

Related Questions

Disclaimer: this is not a question about how to install asp.net or an application
Disclaimer: This question is not about fixing visual studio So, I've used VSS for
Disclaimer This is not a question about whether we should be escaping for database
Disclaimer: This question is strictly academic. The example I'm about to give is probably
DISCLAIMER: This question was not meant to be argumentative! What is fastest and less
Disclaimer: this question is purely informational and does not represent an actual problem I'm
Disclaimer When I wrote this question I was wrong about the behavior of the
Disclaimer: This question is meant to be purely theoretical, so please don't ask me
Disclaimer: I tried to search for similar question, however this returned about every C++
Disclaimer Despite the title, this is a genuine question, not an attempt at Emacs/Vi

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.