共 21 篇文章 |
|
Java 数字不足位数补0.String aa= String.format("%04d", 1);System.out.println(aa);//输出结果 0001.String bb=String.format("%-4s", 1).replace(" ", "0");System.out.println(bb);//输出结果 1000. 阅777 转0 评0 公众公开 20-05-22 21:28 |
Java 重写Object类的常见方法-equals和hashCode.} public static void main(String[] args) { Map<HashMapTest, Integer> map = new HashMap<HashMapTest, Integer>();反过来,我们再分析上面那段代码,Map的key是我们自己定义的一个类,可以看到,我们没有重写equal方法,更没重写hashCode方法,意思是map在进行存储的时候是调用... 阅234 转0 评0 公众公开 19-08-16 10:28 |
private static String bad_ip_error = "Invalid Access IP Address";IP黑名单检查 String blockIpAddressInDB = merchantKeyCacheService.getBlockIpAddress(merchantId, apiRight.value().getValue()); if(StringUtils.isNotEmpty(blockIpAddressInDB)) { boolean isInRange = IpAddressUtils.isInRange(currentClientIp, blockIpA... 阅44 转0 评0 公众公开 18-12-07 12:00 |
阅48 转0 评0 公众公开 16-06-17 15:17 |
阅149 转2 评0 公众公开 16-06-17 15:16 |
阅1374 转1 评0 公众公开 16-06-17 15:12 |
阅43 转0 评0 公众公开 16-06-17 15:11 |
double与String之间的相互转换方法。System.out.println("===Change double to String===");// toString(String) method System.out.println("s is "+ s);// valueOf(String) method System.out.println("s is "+ s);System.out.println("===change String to double===");//Returns a new double... 阅9308 转6 评0 公众公开 15-01-09 11:55 |
阅4886 转30 评0 公众公开 14-12-05 18:11 |
阅1069 转5 评0 公众公开 14-12-05 18:00 |