0 votes
in Scala Constructs by
What are the types of inheritance supported by Scala?

1 Answer

0 votes
by

There are various types of inheritance supported by Scala, including single, multilevel, multiple, and hybrid. Single, multilevel, and hierarchy can all be applied to your class. Due to the fact that Scala doesn't allow multiple inheritances, Scala's trait comes into play to deal with the problem. Traits are defined in a similar manner to classes, except that they use the keyword trait rather than the class as shown below: 

 trait TraitName  

    //Methods 

    //Fields 

Related questions

0 votes
asked Sep 10, 2022 in Scala Constructs by Robin
0 votes
asked Feb 9, 2021 in JAVA by SakshiSharma
...