09 2022 档案

摘要:线程的状态:New、Runnable、Blocked、Waiting、Timed waiting、Terminated new Thread()——> New、 start()——> Runnable、 等待资源——>Blocked、wait()——> waiting 等 锁:ReentrantLo 阅读全文
posted @ 2022-09-30 11:35 迷路的圆 阅读(16) 评论(0) 推荐(0) 编辑
摘要:1. 泛型类 public class Pair<T> { private T first; private T second; public void setSecond(T second){...} .... } 2. 泛型方法 class ArrAlg{ public static <T> T 阅读全文
posted @ 2022-09-25 21:54 迷路的圆 阅读(52) 评论(0) 推荐(0) 编辑
摘要:https://www.pudn.com/detail/6011226 阅读全文
posted @ 2022-09-16 14:38 迷路的圆 阅读(15) 评论(0) 推荐(0) 编辑
摘要:1. 在Java程序语言中,接口是对类的一种描述。例如Arrays类中sort方法声明可以对对象进行排序,但前提是对象所属的类必须实现Comparable接口。 public interface Comparable<T> { int compareTo(T other); } public int 阅读全文
posted @ 2022-09-07 14:44 迷路的圆 阅读(59) 评论(0) 推荐(0) 编辑
摘要:最近项目需要,将C++的算法工程编译成动态链接库,交给 Java后台当作函数库调用。就去了解了下Jni。使用起来还是比较方便的。 1. 首先编写Java的调用类。例如: public class TestJni(){ static{ System.loadLibrary("TestJinDll"); 阅读全文
posted @ 2022-09-06 17:21 迷路的圆 阅读(1131) 评论(0) 推荐(0) 编辑