Код: Выделить всё
interface MyInterface {
fun run();
}
Код: Выделить всё
val actions = arrayOf(
object: MyInterface {
fun run(){
//do something
}
},
object: MyInterface {
fun run(){
//do something
}
}
);
Код: Выделить всё
class MyClass {
virtual void run();
}
MyClass actions[10] = {
new MyClass(){
void run() {
// something
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/792 ... class-in-c