在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
dynamic 表示是动态的,数据类型是指任意类型 var a; a = 10; a = "Dart"; print(a); dynamic b = 20; b = "JavaScript"; print(b); print(b.runtimeType); var list = new List<dynamic>(); list.add(1); list.add("hello"); list.add(true); print(list); print("\n"); dynamic x ='hal'; print(x.runtimeType);//数据类型 print(x); x = 123; print(x.runtimeType); print(x); var a1 = 'var'; print(a1.runtimeType); print(a1); // Object Object o1 ='111'; print(o1.runtimeType); print(o1); o1.toString(); print(o1); 输出: Dart JavaScript String [1, hello, true] String hal int 123 String var String 111 111
dynamic、var、object 三种类型的区别 Dart学习系列文章:https://www.cnblogs.com/jukaiit/category/1636484.html
|
请发表评论