摘要:
映射中的每一个元素包含一个键对象和一个值对象,键不可以重复,值可以重复import java.util.HashMap;public class Test { public static void main(String[] args) { // TODO Auto-generated method stub HashMap hashMap = new HashM... 阅读全文
posted @ 2020-09-06 23:34
thomas_blog
阅读(127)
评论(0)
推荐(0)
摘要:
集合中的对象不按特定的方式排序,并且没有重复对象import java.util.HashSet;import java.util.Iterator;import java.util.Set;public class Test { public static void main(String[] args) { // TODO Auto-generated method stu... 阅读全文
posted @ 2020-09-06 22:38
thomas_blog
阅读(100)
评论(0)
推荐(0)
摘要:
import java.util.ArrayList;public class Test { public static void main(String[] args) { // TODO Auto-generated method stub ArrayList arrayList = new ArrayList(); arrayList.add(... 阅读全文
posted @ 2020-09-06 22:11
thomas_blog
阅读(124)
评论(0)
推荐(0)
摘要:
public class MyThread implements Runnable { int i = 0; @Override public void run() { while (true) { synchronized (this) { // TODO Auto-generated method stub ... 阅读全文
posted @ 2020-09-06 14:01
thomas_blog
阅读(153)
评论(0)
推荐(0)
摘要:
public class MyThread implements Runnable { @Override public void run() { // TODO Auto-generated method stub for (int i = 0; i < 100; i++) { System.out.println(Thread.cu... 阅读全文
posted @ 2020-09-06 12:46
thomas_blog
阅读(124)
评论(0)
推荐(0)