判断字符串是否为null,使用 == 号

来源:互联网 发布:cad是什么软件 编辑:程序博客网 时间:2024/06/05 18:33
java基础薄弱,在项目中  String str;    判断str 是否为空  我写的是if(str.equals(null)){....};  显然这是错的 。蒙圈了,应使用 str == null 判断str是否为空。
0 0