首页 > 文档 > null空,不是有效数据
2017
06-30

null空,不是有效数据

null

例子:

 

String content = "It is a beautiful day.";

String[] results;  // 申请一个空的字符串

 

results = match(content, "orange");

//上面的匹配语句将无法在字符串“内容”中找到“橙色”,

// 因此它将返回一个空值到“result”。

if (results == null) {

  println("Value of 'results' is null.");

} else {

  println("Value of 'results' is not null!"); 

}

 

 

描述:

用于表示目标的特殊值不是有效的数据元素。 在处理中,当尝试访问不存在的数据时,您可以在关键字null中运行。

 



最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。