创建List : var list = [1,2,3,"Dart",true]; 创建不可变List : var list = const [1,2,3,"Dart",true]; 构造创建:var list3 = new List(); 常用操作: [],length,add(),insert(),remove(),clear()indexOf(),lastIndexOf()排序sort(),子数组 sublist()打乱shuffle(),转为Map: asMa
一.Map,Set,Array对比: 1.增 let map = new Map(); let set = new Set(); let array = []; map.set('t',1); //Map set.add({t:1}); //Set array.push({t:1});//数组 console.info('set-map-array',set,map,array); 2.查 let map_exist = map.has('t'); let set_exist = set.has
package test; import java.util.*; /** * Created by ming */ public class Test { public static void main(String[] args) { Set<Long> longSet=new HashSet<>(); longSet.add(1L); longSet.add(2L); List<Long> longList=new ArrayList<>(); lon
Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is over, they will count the balloons of each color and find the result.