首页 > 代码库 > 真与假与c#,java中的不同之处
真与假与c#,java中的不同之处
/************真与假************/
/*C语言中:真(非0)、假(0)
* Java、C#中:真(true)、假(false)
* JavaScript中:真(非0、true、非null)、假(0、false、null)
*/
var x,y,z;
x=2;
if(x){
document.write("非0为真!");
document.write("<br>");
}
y=true;
if(y){
document.write("true为真!");
document.write("<br>");
}
z="abc";
if(z){
document.write("非null为真!");
document.write("<br>");
}
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。