inheritance in javamultiple inheritance is allowed for interfaces but not for classes the reason for this rule is that the methods of an interface never have bodieswhile methods in class always do thusif java were to allow for multiple inheritance for classesthere could be confusion if class tried to extend from two classes that contained methods with the same signatures this confusion does not exist for interfaceshoweversince their methods are empty sosince no confusion is involvedand there are times when multiple inheritance of interfaces is usefuljava allows for interfaces to use multiple inheritance one use for multiple inheritance of interfaces is to approximate multiple inheritance technique called the mixin unlike javasome object-oriented languagessuch as smalltalk and ++allow for multiple inheritance of concrete classesnot just interfaces in such languagesit is common to define classescalled mixin classesthat are never intended to be created as stand-alone objectsbut are instead meant to provide additional functionality to existing classes such inheritance is not allowed in javahoweverso programmers must approximate it with interfaces in particularwe can use multiple inheritance of interfaces as mechanism for "mixingthe methods from two or more unrelated interfaces to define an interface that combines their functionalitypossibly adding more methods of its own returning to our example of the antique objectswe could define an interface for insurable items as followspublic interface insurableitem extends transportablesellable /*returns insured value in cents *public int insuredvalue()this interface mixes the methods of the transportable interface with the methods of the sellable interfaceand adds an extra methodinsuredvalue such an interface could allow us to define the boxeditem alternately as followspublic class boxeditem implements insurableitem /same code as class boxeditem in this casenote that the method insuredvalue is not optionalwhereas it was optional in the declaration of boxeditem given previously java interfaces that approximate the mixin include java lang cloneablewhich adds copy feature to classjava lang comparablewhich adds