Any way to extend two or more classes in java?

前端 未结 12 1532
再見小時候
再見小時候 2021-01-17 02:20

I know that Java does not allow us to extend more than one class. I know that interfaces also exist and I don\'t want to use them this time. Is there some kind of trick or w

12条回答
  •  难免孤独
    2021-01-17 03:09

    Java not support this for classes.You can use multiple interfaces.You can find what the problem with multiple inheritance in java

    You can use inner classes like

     public class class1 extends class2{
      class Inner extends class3{
    
        }
       }
    

    SEE HERE

提交回复
热议问题