![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
我为offer而来
这个作者很懒,什么都没留下…
展开
-
双重循环 判断 list 对象中 是否存在重复的数据
废话不多说:public class DeptTest { public static void TEST(List<Dept> list) { for (int i = 0; i < list.size()-1; i++) { System.out.println("下标 i="+i+"----"+list.get(i).getId()+"-----"+list.get(i).getDeptCode()+"------------原创 2022-01-20 18:49:02 · 827 阅读 · 0 评论 -
利用正则表达式判断字符串是否是数字
/*** 利用正则表达式判断字符串是否是数字* @param str* @return/public boolean isNumeric(String str){if(str != null && str !="") {Pattern pattern = Pattern.compile("[0-9]");Matcher isNum = pattern.matcher(str);if (!isNum.matches()) {return false;}return tr原创 2022-01-11 18:29:02 · 136 阅读 · 0 评论 -
根据对象的属性值 进行排序
废话不多说,直接上代码:public class Student { public String name; public int age; public String getName() { return name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; }原创 2022-01-11 18:26:02 · 152 阅读 · 0 评论