Dart & data type(static / dynamic)
🎯 Darts 飞镖
标枪 javelin/darts
type
void main() {
// abstract class String implements Comparable<String>, Pattern
String s = "string type";
print(s);
// String s
// Number n = 123;
// Error: 'Number' isn't a type.
int i = 123;
// Number, int i
print(i);
double d = 3.1415926;
// Number, double d
print(d);
}
live demo
https://gist.github.com/xgqfrms/a912f29d6d79f674f3ba8c6d65686f68
https://dartpad.dev/a912f29d6d79f674f3ba8c6d65686f68
iframe
<iframe height="435" style="width: 100%;" scrolling="no" title="dart data type " src="https://dartpad.dev/a912f29d6d79f674f3ba8c6d65686f68" frameborder="no" allowtransparency="true" allowfullscreen="true">
fallback link
<a hfre="https://gist.github.com/xgqfrms/a912f29d6d79f674f3ba8c6d65686f68">https://gist.github.com/xgqfrms/a912f29d6d79f674f3ba8c6d65686f68</a>
</iframe>
https://github.com/dart-lang/dart-pad/wiki/Sharing-Guide
gist id => DartPad url
https://gist.github.com/xgqfrms/2ada2477a76d65cbd4b16558131fcbc0
https://dartpad.dev/2ada2477a76d65cbd4b16558131fcbc0
refs
https://medium.com/run-dart/dart-dartlang-introduction-variables-and-data-types-d269ea7d1f8f
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!