![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java
yes1234500
这个作者很懒,什么都没留下…
展开
-
使用java的java.security.MessageDigest类进行不可逆加密
/** * MD5加码。32位 * @param inStr * @return */ public static String MD5(String inStr) { MessageDigest md5 = null; try { md5 = MessageDigest.getInstance("MD5"); } catch (Exception e) {转载 2013-06-24 12:07:28 · 725 阅读 · 0 评论 -
使用Builder来解决多成员Bean的初始化问题
自己在做开发的时候,遇到过自己抽象的一个Bean类,拥有很多的成员变量。我们对这些个成员变量设置了private权限,然后用getter和setter来获取和设置变量值。在创建这些Bean类的实例的时候,有时候是因为懒(不想一个个的调用setter去设值),又或者是怕自己忘记给某个成员赋值(为此我可能还会在时候这些成员变量的时候再判断了一次是不是未赋值,又多写了一些代码),我又会给Bean类写一个...原创 2018-09-24 00:57:41 · 257 阅读 · 0 评论 -
What if there is a return statement in finally block?
In normal situation this is how we use the try-catch-finally statement:try { //Code}catch (Exception e) { //Handle the exceptional case}finally { //Clean up code to be executed no mat...原创 2018-09-24 14:13:51 · 298 阅读 · 0 评论 -
Precedence of Spring boot customize configuration
A note from book Spring boot in Action, 1st edition by Craig Walls , chapter 3:There are, in fact, several ways to set properties for a Spring Boot application. Spring Boot will draw properties fro...转载 2018-12-15 22:03:16 · 222 阅读 · 0 评论 -
The class name of an array object
Quote from Java API documentation https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#getName--If this class object represents a class of arrays, then the internal form of the name consi...转载 2018-12-25 21:51:20 · 112 阅读 · 0 评论 -
Java源码中查找方法汇总(待完善)
Java的API中提供了很多Util,这篇文章将对我看的源码里面的排序方法进行总结:1. 二分查找法a) Arrays.binarySearch(Object[] a, Object key)前提:a要先做好排序,并且是正向排序返回值:如果key在a中,则返回key在a的位置,否则返回key应在a的插入点+1的和的负值。 PS:我会在探索中不断补充本文。...原创 2018-12-26 00:57:25 · 286 阅读 · 0 评论