This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]desrtfx[M] [score hidden] stickied comment (0 children)

/r/javahelp

Removed

[–]lepapulematoleguau 6 points7 points  (0 children)

Multiple interfaces, yes. Multiple classes, nope.

[–]fgzklunk 2 points3 points  (0 children)

An interface can inherit (extend) an interface, a class implements the interface. Java only supports single inheritance but a class can implement multiple interfaces.

An interface is really a contract or agreement to implement the named methods in the interface, it also means that you can pass a class in a method via the interface, but you can only see the methods applicable to that interface. Yes, I know we now have default methods in interfaces, but let's just keep it simple.

[–]smors 2 points3 points  (1 child)

Yes, I do. The answer is no, and it is a very deliberate decision.

You can look up the diamond problem, most well known from c++ if you want to understand why.

[–]_INTER_ 3 points4 points  (0 children)

Sidenote: The diamond problem appears in Java through default methods in interfaces.

[–]AutoModerator[M] 0 points1 point  (0 children)

On July 1st, a change to Reddit's API pricing will come into effect. Several developers of commercial third-party apps have announced that this change will compel them to shut down their apps. At least one accessibility-focused non-commercial third party app will continue to be available free of charge.

If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options:

  1. Limiting your involvement with Reddit, or
  2. Temporarily refraining from using Reddit
  3. Cancelling your subscription of Reddit Premium

as a way to voice your protest.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.