在abstract class
中,我希望定义静电方法,但是我遇到了问题.
在这个简单的示例中
abstract class Main {
static String get name;
bool use( Element el );
}
class Sub extends Main {
static String get name => 'testme';
bool use( Element el ) => (el is Element);
}
我收到错误:
方法‘Get:Name’应为函数体,静电字符串GET NAME;
声明中有没有拼写错误,或者静电方法与抽象类不兼容?