What do you mean by trait in scala and when it is used?
Answer / Ramgopal Singh
A Trait in Scala is a type that contains a certain number of methods, without providing their implementations. It allows for multiple inheritance (mixing) of behaviors. Traits are primarily used when a class needs to reuse code written in other classes. They can be mixed into classes and other traits using with keyword.
| Is This Answer Correct ? | 0 Yes | 0 No |
What are the advantages of case class?
How do I append data in a list?
What is a stream in scala?
What language is scala written in?
What is the final class in scala?
Like Hibernate for Java-based applications, What are the Popular ORM Frameworks available to use in Play/Scala based applications?
What are the popular MVC frameworks for Scala Language to develop Web Applications?
What is Statically-Typed Language and What is Dynamically-Typed Language?
Why is scala good for big data?
What is scala best used for?
Does Scala support all Functional Programming concepts? Does Java 8 support all Functional Programming concepts?
What is an array in scala?