摘要: 实现Runnable接口的方式实现四个线程卖100张火车票的问题 点击查看代码 public class TestTicket { public static void main(String[] args) { // 启动四个线程卖票。 TicketThread tt = new TicketTh 阅读全文
posted @ 2022-01-07 17:57 shark_zzz 阅读(159) 评论(0) 推荐(0)
摘要: `import java.io.*; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; public class ZipDir { public static void main(String[] args) { 阅读全文
posted @ 2022-01-07 17:53 shark_zzz 阅读(65) 评论(0) 推荐(0)
摘要: `import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; public class ProxyInvocationHandler impl 阅读全文
posted @ 2022-01-07 17:49 shark_zzz 阅读(31) 评论(0) 推荐(0)
摘要: 删除一个非空目录。 linux shell命令:rm -rf 点击查看代码 /** * 删除一个非空目录。 linux shell命令:rm -rf * * @param path 要删除的目录。 */ public static void deleteDirectory(String path) 阅读全文
posted @ 2022-01-07 17:45 shark_zzz 阅读(53) 评论(0) 推荐(0)
摘要: `/** 日期工具类。 */ public class DateUtils { /** * 提供一个日期,然后通过指定的模式格式化,然后返回日期的字符串。 Date > String 的转换。 * * @param date 要格式化的日期 * @param pattern 按照什么来格式化日期(2 阅读全文
posted @ 2022-01-07 13:56 shark_zzz 阅读(11) 评论(0) 推荐(0)
摘要: `public class MyStack { private Object[] objects = new Object[10]; private int count; public boolean empty(){ for (int i = 0; i < objects.length; i++) 阅读全文
posted @ 2022-01-07 13:52 shark_zzz 阅读(47) 评论(0) 推荐(0)
摘要: `public class MyArrayList{ private Object[] objects = new Object[10]; private int count; public void add(Object value){ if(count==objects.length){ Obj 阅读全文
posted @ 2022-01-07 13:50 shark_zzz 阅读(29) 评论(0) 推荐(0)
摘要: `public class YangHuiTriangle { public static void main(String[] args) { int[][] arrays = new int[7][7]; for (int i = 0; i < arrays.length; i++) { //将 阅读全文
posted @ 2022-01-07 10:55 shark_zzz 阅读(233) 评论(0) 推荐(0)
摘要: `public class SelectSort { public static void main(String[] args) { int[] arrays = {6,12,9,15,4,2,18}; for(int i = 0;i < arrays.length-1;i++) { //第一层循 阅读全文
posted @ 2022-01-07 10:54 shark_zzz 阅读(28) 评论(0) 推荐(0)
摘要: `public class InsertSort { public static void main(String[] args) { int[] arrays = {6,12,9,15,4,2,18}; int i,j,temp; //提升作用域 for (i = 1; i < arrays.le 阅读全文
posted @ 2022-01-07 10:53 shark_zzz 阅读(34) 评论(0) 推荐(0)