Sự khác nhau giữa set và list

Here ist a clear example with groovy. i create a set and a list. then i try to store 20 randomly generated value within each list. the generated value can be in range 0 to 5

s = [] as Set l = [] max = 5 print "random Numbers :" 20.times{ e = [int]Math.random[]*max s

Chủ Đề