public class TestString {
    public static void main(String[] args) {
        String abc = null;
        //先判断是否为null再判断是否为空.
        if(abc != null && !abc.isEmpty())
        {
            System.out.println("true");
        }else{
            System.out.println("false");
        }

    }
}

 

posted on 2017-02-20 15:31  del88  阅读(135)  评论(0编辑  收藏  举报