2018年终总结
2018年终总结 总的来说,2018是折腾的一年,2019仍然充满未知和期待。 2018也是很有趣的一年,碰到很多有趣的人,经历几个有趣的项目。自己视野开阔了一些,世界这么大,我想溜达溜达。 2018是穷忙的一年,加了不少班,结果没有看到。三个字,自找的。 欣慰的是,2018年亲人身体安康,爸...
Java泛型
Java generic(泛型)笔记 extends 和 super123public static <T extends Comparable<? super T>> void sort(List<T> list) { list.so...
为什么InputStream read返回int
Java InputStream read返回int 问题InputStream 操作的是字节流,read字面上理解应该返回字节,为什么api中返回的是int 123456789public abstract int read() throws IOExcep...
Java volatile
Java volatile volatile 语义 内存可见性,不保证原子性(++i) 禁止指令重排 (单例设计模式) 保证double/long的读写原子性(不然32bit+32bit操作会有不一致) 关于第三点,可以参考jls 1234567891017.7. Non-atom...
getMethods 和 getDeclaredMethods
getMethods和getDeclaredMethods的区别 getMethods public Method[] getMethods() throws SecurityExceptionReturns an array containing Meth...
Java 对象大小
java对象内存layout Class : A pointer to the class information, which describes the object type. In the case of a java.lang.Integer object, for example...
链接收藏
收藏的链接地址 Java泛型
Java类型检查
Java类型转换前一般有三种方式进行类型检查 isAssignableFrom isInstance instanceof isAssignableFromX.class.isAssignableFrom(Y.class) If X and Y are the same class, o...
Java annotation的继承性
Java annotation只能从超类继承不能从接口继承 Javadoc Indicates that an annotation type is automatically inherited. If an Inherited meta-annotation is present on ...
mysql8 Workbench连接问题
升级到mysql8以后,原有的Mysql Workbench连接出现下面的异常 1Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/mysql/lib/plug...