Loading...
dart中的类与对象 void main(){ var person = new Pesron();//new 可以省略 person.name = "Tom"; person.age = 20 ; print(person.name); person.work(); } class Pesron...
## 定义方法 ## void main(List args){ print(getPerson('张三', 18)); print(printPerson('李四', 20)); print(newPerson('王五', 30)); } String getPerson(String name, int age){ return "na...
dart 中的变量和常量 void main(){//固定的方法 var a = 10; print(a); final c =30;//关键字 关注字只能被赋值一次 print(c); const d =20; //常量 只能被赋值一次 print(d); }
list void main(){ var list1 = [1,2,3,"dart",true]; print(list1); print(list1[1]); list1[1] = 'hello'; print(list1); var list2 = const [1,2,3]; print(list2); ...
map## 标题文字 ## void main(){ var map1 = {"first":'dart',1:true}; print(map1); print(map1['first']); map1[1] = false; print(map1); var map = {"first":'dar...