Python では、decorator を使用してプロパティのようにメソッドにアクセスできる可能性があります@property
。ダートにこんなのありますか?
class Test():
@property
def example():
return "This isn't really a property"
a = new Test()
print a.example
Python では、decorator を使用してプロパティのようにメソッドにアクセスできる可能性があります@property
。ダートにこんなのありますか?
class Test():
@property
def example():
return "This isn't really a property"
a = new Test()
print a.example
ゲッターの概念は似ています:
class Test {
String get example {
return "This isn't really a property";
}
}
main() {
var a = new Test();
print(a.example);
}