java 实例化一个对象怎么判断它为不为空

2024-11-19 16:35:02
推荐回答(2个)
回答1:

if(实例化对象==null)
{...}

回答2:

A a =new A();
if(a != null){
System.out.println("芦迟物隐not null");
}else{
System.out.println("null"陪蚂李);
}