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.