isNotEmpty(str)等价于 str != null && str.length > 0 isNotBlank(str) 等价于 str != null && str.length > 0 && str.trim().length > 0 同理 isEmpty 等价于 str == null... ...
分类:
编程语言 时间:
2019-05-23 15:53:24
阅读次数:
103
先看结果 分析源码 【jdk源码解析】jdk8的ArrayList初始化长度为0 java的基本数据类型默认值 无参构造 size()方法 isEmpty()方法 ...
分类:
其他好文 时间:
2019-04-28 00:01:43
阅读次数:
169
1 //二叉树的先序遍历(非递归) 2 public void PreOrderTraverse() 3 { 4 BiTNode p = this.root; 5 Stack stack = new Stack(10000); 6 7 while(!stack.isEmpty || p != nul... ...
分类:
其他好文 时间:
2019-04-22 09:20:01
阅读次数:
114
返回的map对象在!=null的时候有两种情况,一种是没有数据 返回的是{},另外一种是有数据。 判断的时候map!=null&&!map.isEmpty() <!--5f39ae17-8c62-4a45-bc43-b32064c9388a:W3siYmxvY2tJZCI6IjgydWZydzE0O ...
分类:
其他好文 时间:
2019-04-14 13:56:42
阅读次数:
92
import turtle class Stack: def __init__(self): self.items = [] def isEmpty(self): return len(self.items) == 0 def push(self, item): self.items.append( ...
分类:
其他好文 时间:
2019-03-28 00:43:01
阅读次数:
317
Map的常用操作 1. [] , length 获取值和长度 2. isEmpty (),isNoEmpty () 是否为空 3.Keys ,values 获取所有的键 和值 4. containsKey(), containsValue() 是否包含某个key 是否包含某个值 5.remove ( ...
分类:
其他好文 时间:
2019-03-11 10:25:22
阅读次数:
214
常用集合类的使用 java中的集合,不管是List,Set,还是Map,都是继承自collection接口,这个接口主要定义了集合类的一些公关方法,比如isEmpty(), remove(),add()等,在使用集合类的时候除了顺序遍历,还提供了一种方便的迭代器遍历的方法,在遍历过程中需要remov ...
分类:
编程语言 时间:
2019-02-21 15:29:31
阅读次数:
138
isEmpty(String str) 是否为空,空格字符为false isNotEmpty(String str) 是否为非空,空格字符为true isBlank(String str) 是否为空,空格字符为true isNotBlank(String str) 是否为非空,空格字符为false ...
分类:
其他好文 时间:
2019-02-15 13:19:53
阅读次数:
132
Set set = map.keySet(); if(set != null && !set.isEmpty()) { for(String key : set) { if(map.get(key) == null) { map.put(key, ""); } ... ...
分类:
其他好文 时间:
2019-01-29 01:13:27
阅读次数:
212
常用方法: isEmpty:判断字符串是否为空值 getTrimmedLength:获取字符串去除头尾空格之后的长度 isDigitsOnly:判断字符串是否全部由数字组成 ellipsize:如果字符串超长,则返回按规则截断并添加省略号的字符串 使用方式: TextUtils.isEmpty(st ...
分类:
其他好文 时间:
2019-01-20 17:27:38
阅读次数:
333