In Java, you can do such thing as:
class MyClass extends SuperClass implements MyInterface, ...
Is it possible to do the same thing in Kotlin? Assuming SuperClass
is abstract and does not implement MyInterface
In Java, you can do such thing as:
class MyClass extends SuperClass implements MyInterface, ...
Is it possible to do the same thing in Kotlin? Assuming SuperClass
is abstract and does not implement MyInterface
There's no syntactic difference between interface implementation and class inheritance. Simply list all types comma-separated after a colon :
as shown here:
abstract class SuperClass
interface MyInterface
class MyClass : SuperClass(), MyInterface, Serializable
Multiple class inheritance is prohibited while multiple interfaces may be implemented by a single class.