通过上面的测试,得出结论:size()方法比isEmpty()耗时更长,原因是size() 是要遍历一遍集合的. ...
分类:
其他好文 时间:
2018-06-05 15:26:41
阅读次数:
437
单文件上传 public String SingleUpload(MultipartFile file, String url) { String fix; String fileName; File tempFile; if (!file.isEmpty()) { fix = getFix(fil... ...
分类:
编程语言 时间:
2018-05-21 14:39:50
阅读次数:
182
1. public static boolean isEmpty(String str) 2. public static boolean isNotEmpty(String str) 3. public static boolean isBlank(String str) 4. public st ...
分类:
其他好文 时间:
2018-05-10 15:44:23
阅读次数:
151
栈:FILO 其实就是一端增加和一端删除的链表 一般我们对头进行增加和删除 几个必要函数:1.Init 2.Push 3.Pop 4.Clear 5.Destroy 6.GetTop 7.GetCount 8.IsEmpty 怎样销毁栈? 销毁后不能进行Push 和Pop 1.设置标志,执行销毁函数 ...
分类:
其他好文 时间:
2018-05-09 15:11:38
阅读次数:
178
1 isNotEmpty(str)等价于 str != null && str.length > 0 2 isNotBlank(str) 等价于 str != null && str.length > 0 && str.trim().length > 0 3 同理 4 isEmpty 等价于 str ...
分类:
编程语言 时间:
2018-05-08 12:12:19
阅读次数:
299
先上一张图:关于collection接口的 一、Collection中的常用功能: boolean add(Object e): 向集合中添加元素void clear():清空集合中所有元素boolean contains(Object o):判断集合中是否包含某个元素boolean isEmpty ...
分类:
编程语言 时间:
2018-05-04 14:11:13
阅读次数:
187
1、如果想判断list是否为空,可以这么判断: 2、list.isEmpty() 和 list.size()==0 有啥区别呢 答案:没有区别 。 isEmpty()判断有没有元素,而size()返回有几个元素, 如果判断一个集合有无元素 建议用isEmpty()方法.比较符合逻辑用法。 3、lis ...
分类:
编程语言 时间:
2018-05-03 12:08:54
阅读次数:
218
二叉树的定义 类型名称:二叉树 数据对象集:一个有穷的结点集合。若不为空,则有根结点和其左、右二叉子树组成。 操作集:BT∈BinTree, Item∈ElementType,重要操作有: 1、Boolean IsEmpty(BinTree BT):判别BT是否为空 2、void Traversal ...
分类:
其他好文 时间:
2018-04-05 14:34:36
阅读次数:
201
MD5摘要算法: <span style="font-size:18px;">主要代码: String s = edit.getText().toString(); if (TextUtils.isEmpty(s)){ Toast.makeText(getActivity(), "摘要数据不可为空" ...
分类:
移动开发 时间:
2018-03-20 20:47:40
阅读次数:
279
public static boolean isEmpty(String str){ if("".equals(str)||str==null){ return true; }else{ return false; } } public static boolean isNotEmpty(Strin ...
分类:
编程语言 时间:
2018-03-17 19:41:56
阅读次数:
206