黑马程序员技术交流社区
标题:
代码补全打印想要结果
[打印本页]
作者:
赵佳
时间:
2013-7-5 22:05
标题:
代码补全打印想要结果
本帖最后由 杜光 于 2013-7-6 08:00 编辑
public class Text {
public static void main(String[] args) {
if(___________){
System.out.println("world");
}
else{
System.out.println("hello");
}
}
}
只能在if(_____)里面写代码,如何让输出结果是“hello world”?
作者:
刘_鑫
时间:
2013-7-5 22:13
楼主试试这样写
package test;
public class NewDemo {
public static void main(String[] args) {
if (System.out.append("hello ") != null) {
System.out.println("world");
} else {
System.out.println("hello");
}
}
}
[4%E]RSM1}CBXHT53QG}Q`K.jpg
(14.18 KB, 下载次数: 0)
下载附件
2013-7-5 22:13 上传
作者:
宋智超
时间:
2013-7-5 22:15
public class Text {
public static void main(String[] args) {
if(System.out.printf("hello ")!=null) {
System.out.println("world");
}
else{
System.out.println("hello");
}
}
}
复制代码
作者:
lipingan0520
时间:
2013-7-7 09:35
public class Text11
{
public static void main(String[] args)
{
{
System.out.print("Hello "); //构造代码块
}
if(new Text11() != null)
{
System.out.println("World");
}
else
{
System.out.println("Hello");
}
}
}
复制代码
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2