作业帮 > 综合 > 作业

public static Customer hasCustomer(String id,String pwd) { i

来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/08/07 07:22:26
public static Customer hasCustomer(String id,String pwd) { if ( ( id == null || id.length() < 1) &&
public static Customer hasCustomer(String id,String pwd)
{
if ( ( id == null || id.length() < 1) && (pwd == null || pwd .length() < 1))
{
return null;
}
.
如果if语句成立,下面的语句还会执行吗,下面不存在else语句,return null
public static Customer hasCustomer(String id,String pwd) { i
不会执行,return 不仅仅有返回的意思 还有跳出的意思 return null 意思是返回一个空值
并且跳出方法 所以下面的代码不会在执行了