摘要: package scoket; /** * 用Arrays.copyof 删除数组中的一个元素 */ import java.util.Arrays; public class test { public static void main(String[] args) { int[] arr = { 1, 5, 9, 8, 7, 6, 4, 3, }; System.out.pr... 阅读全文
posted @ 2018-01-11 17:48 清风已来 阅读(328) 评论(0) 推荐(0)
摘要: package thread; import java.util.Arrays; import java.util.Random; public class Thread_join { public static void main(String[] args) { /** * 2个线程共享同一个数组,t1负责向数组中添加100个随机数, * t2负责排序,其中t2要等... 阅读全文
posted @ 2018-01-11 13:06 清风已来 阅读(120) 评论(0) 推荐(0)
摘要: package thread; public class Thread_yield { public static void main(String[] args) { /** * 线程让出当前占用的处理器CPU */ Thread t1 = new ThreadDemo("t1"); Thread t2 = new ThreadDemo("t2"); t1.s... 阅读全文
posted @ 2018-01-11 10:44 清风已来 阅读(389) 评论(0) 推荐(0)
摘要: package thread; public class Thread_Daemon { public static void main(String[] args) { /** * 后台线程在全部前台线程结束后,后台线程被结束 * * 推论:java进程在全部前台线程结束时候结束。 * 如果java进程没有结束的话,则说明存在一个以上的没有结束的前台线程正在... 阅读全文
posted @ 2018-01-11 09:59 清风已来 阅读(117) 评论(0) 推荐(0)