A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© 刘_鑫 中级黑马   /  2013-7-2 07:25  /  1375 人查看  /  5 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

package ifjg;
public class Tex {
public static void main(String[] args) {
  if(___________){
   System.out.println("world");
  }
  else{
   System.out.println("hello");
  }
}
}
只能在if(_____)里面写代码,如何让输出结果是“hello world”?

评分

参与人数 1技术分 +1 收起 理由
孙百鑫 + 1 赞一个!

查看全部评分

5 个回复

倒序浏览
这样挺OK的!{:soso_e189:}
  1. public class Tex
  2. {
  3.         public static void main(String[] args)
  4.     {
  5.                 if(System.out.append("hello ") != null)
  6.                 {
  7.                         System.out.println("world");
  8.                 }
  9.                 else
  10.                 {
  11.                         System.out.println("hello");
  12.                 }
  13.     }
  14. }
复制代码

评分

参与人数 1技术分 +1 收起 理由
孙百鑫 + 1 神马都是浮云

查看全部评分

回复 使用道具 举报
有意思,但做不出来,看起来违背了语法。想知道答案
回复 使用道具 举报

高人这样都行啊
回复 使用道具 举报
{:soso_e129:} 哈哈
回复 使用道具 举报
在if的()括号中填写为:System.out.append("hello")!=null 即可。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马