A trait syntax

You need to use the trait keyword in order to declare a trait and it should be followed by the trait name and body:

trait Animal {
val age : Int
val gender : String
val origin : String
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.176.0