摘要: //Runnable接口更适合多线程共用一个资源的情况,并且避免了单继承的限制public class test02 { public static void main(String[] args) { Dog dog = new Dog(); Thread thread = new Thread( 阅读全文
posted @ 2023-03-30 15:51 霍叔 阅读(70) 评论(0) 推荐(0) 编辑
摘要: public class test1 { @SuppressWarnings({"all"}) public static void main(String[] args) throws InterruptedException { Cat cat = new Cat(); cat.start(); 阅读全文
posted @ 2023-03-30 14:21 霍叔 阅读(40) 评论(0) 推荐(0) 编辑
摘要: Map map = new HashMap(); map.put("邓超","孙俪"); map.put("张三","王五"); map.put("李四","赵六"); map.put(null,"关七"); System.out.println("map = " + map);// remove: 阅读全文
posted @ 2023-03-30 09:34 霍叔 阅读(8) 评论(0) 推荐(0) 编辑