Concrete classes

Concrete classes are used to implement the properties and behaviors of a domain and create instances out of it. The following Lion concrete class will inherit from the Animal abstract class:

class Lion : Animal {
var noise: String

constructor(noise: String) {
this.noise = noise;
}

override fun name(): String? {
return "Lion";
}

override fun makeNoise(): String? {
return noise;
}

}

The : symbol is used to specify in the class declaration that one class extends from another. 

..................Content has been hidden....................

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