Q

Multiple interface inheritance in Java

A SearchWebServices.com member asks "What is the disadvantage of using multiple inheritance in Java. How can we solve the problem using interface?" Read the response or pose a question of your own.

What is the disadvantage of using multiple inheritance in Java. How can we solve the problem using interface?

Java does not support multiple class inheritance. Java does, however, support multiple interface inheritance. Therefore, a class can realize multiple "personalities" using something similar to the following construct:

public interface SuperSizable

   extends java.io.Serializable, Comparable

{

   public void superSize();

}
This was first published in January 2006

Dig deeper on Java Web Services

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close