这个题目有人会做么???? if (条件) { System.out.println("Hello"); }else{ System.out.println("World");}只可以在条件里打代码 要求输出Hello World 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 好像是 java解惑 里面的题目吧 if (new Func<bool>(() => { Console.Write("Hello "); return false; }).Invoke()){ Console.WriteLine("Hello ");}else{ Console.WriteLine("world!");} public class Test { public static void main(String[] args) { if(System.out.append("Hello ") == null) { System.out.println("Hello"); } else { System.out.println(" world"); } }}public class Test { public static void main(String[] args) { if(new Object(){{System.out.print("Hello ");}}.equals("")) { System.out.println("Hello"); } else { System.out.println("world"); } }}public class Test { public static void main(String[] args) throws Exception { if(System.out.getClass().getMethod("print",String.class).invoke(System.out, "Hello ")!=null){ System.out.print("Hello "); } else { System.out.println("world"); } }}public class Test { public static void main(String[] args) throws Exception { if(args.length == 0 ? Test.class.getDeclaredMethod("main",args.getClass()).invoke(new Test(), new Object[]{new String[]{"a"}}) != null : true){ System.out.print("Hello "); }else{ System.out.println("world"); } }}public class Test { public static void main(String[] args) throws Exception { if (args == null ? true : ((Test.class.getMethod("main", new String[1].getClass()).invoke(new Test(), new Object[1])) instanceof Void)) { System.out.print("Hello "); } else { System.out.println("world"); } }} http://www.javaeye.com/topic/781849 学习下,lamada表达式,这个问题就迎刃而解了 iText生成PDF,显示中文问题 使用Eclipse开发JavaEE需要哪些插件 程序员生涯的抉择 dwr方法不可用 struts 2.0 的问题 配置spring security出错,速救啊! web service比COM/DCOM,EJB,CORBA,RMI到底有什么好处? 菜鸟求救struts小问题。 默认包中,自定义类的互相访问 怎么能用代码做简单的app Cannot create JDBC driver of class '' for connect URL 'null' 用了struts,tomcat启动就出错
{
Console.WriteLine("Hello ");
}
else
{
Console.WriteLine("world!");
}
public static void main(String[] args) {
if(System.out.append("Hello ") == null) {
System.out.println("Hello");
} else {
System.out.println(" world");
}
}
}public class Test {
public static void main(String[] args) {
if(new Object(){{System.out.print("Hello ");}}.equals("")) {
System.out.println("Hello");
} else {
System.out.println("world");
}
}
}public class Test {
public static void main(String[] args) throws Exception {
if(System.out.getClass().getMethod("print",String.class).invoke(System.out, "Hello ")!=null){
System.out.print("Hello ");
} else {
System.out.println("world");
}
}
}public class Test {
public static void main(String[] args) throws Exception {
if(args.length == 0 ? Test.class.getDeclaredMethod("main",args.getClass()).invoke(new Test(), new Object[]{new String[]{"a"}}) != null : true){
System.out.print("Hello ");
}else{
System.out.println("world");
}
}
}
public class Test {
public static void main(String[] args) throws Exception {
if (args == null ? true : ((Test.class.getMethod("main", new String[1].getClass()).invoke(new Test(),
new Object[1])) instanceof Void)) {
System.out.print("Hello ");
} else {
System.out.println("world");
}
}
}