您的位置:首页 > 其它

if语句真正用法

2012-04-24 17:37 274 查看
class  ZhenJiaDemo
{
public static void main(String[] args)
{
if (false)
{
System.out.println("真在执行!!!");
}
else
{
System.out.println("假在执行!!!!");
}
}
}
//if只执行true语句!!!
//else执行false语句!!!
class  ZhenJiaDemo
{
public static void main(String[] args)
{
boolean flag=false;
if (flag)
{
System.out.println("真在执行!!!");
}
else
{
System.out.println("假在执行!!!!");
}
}
}
并不是判断后真才执行if语句!



                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  string class