Java – extends multiple classes

I know that Java does not support multiple inheritance because it does not allow multiple classes to be extended I just want to know if there is a solution to my problem

I have a class named customaction, which needs to extend two abstract classes, baseaction and quotebaseaction I can't change any of these abstract classes and extend other classes

These abstract classes have the method implementations I need to use I can't create an interface either, because an interface can only extend another interface

Any ideas?

Solution

Well done

public class CustomAction extends BaseAction {
  class Inner extends QuoteBaseAction {

  }
}
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>