![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java
孤独即自由
这个作者很懒,什么都没留下…
展开
-
Java中怎么实现生成随机位数的随机字符串
@Test public void test24(){ //假如要获取1-10位的随机数,每一位由a-z或A-Z组成 Random random = new Random(); StringBuffer sb = new StringBuffer(); //获得随机位数1-10 int weishu =...原创 2019-11-06 09:46:02 · 812 阅读 · 0 评论 -
如何用Java实现计算两个时间之间有多少秒
@Test public void test23() throws ParseException { DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date startTime = dateFormat.parse("2019-11-6 09:31:00"); ...原创 2019-11-06 09:34:16 · 1490 阅读 · 0 评论