Base class creation

Report a typo

A class named Derived is inherited from the class Base and defined as follows:

class Derived : Base {
    constructor(id: Int) : super(id)
    constructor(id: Int, length: Float) : super(id, length)
    constructor(id: Int, length: Float, message: String) : super(id, length, message)
}

Create the Base class so that the Derived class definition is valid (you are free to use any default values). It should be possible to instantiate Derived as follows:

Derived(1)
Derived(2, 0.4F)
Derived(3, 5F, "New")
Write a program in Kotlin
// Write your code here
___

Create a free account to access the full topic