怎样在同时输出if else 里面的语句
来源:互联网 发布:广联达软件销售电话 编辑:程序博客网 时间:2024/05/16 15:02
使用反射实现
package com.xf.parent;
import java.lang.reflect.InvocationTargetException;
/**
* 輸出helloword
* @author Administrator
*
*/
public class Test {
public static void main(String[] args) {
try {
if(System.out.getClass().getDeclaredMethod("print", String.class).invoke(System.out, "hello ")!=null){
System.out.println("hello ");
}else{
System.out.println("word");
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
- 怎样在同时输出if else 里面的语句
- if else 同时输出的笔试题
- if else if else 语句的拓展
- 怎样不用判断(if else等)和跳转语句(for while 等)求和以及连续输出
- if else 语句 的优化
- 嵌套的if-else语句
- if..else语句的嵌套
- if else语句的应用
- else if 语句的应用
- shell的if else 语句
- angularjs的if、else语句
- if else语句的使用
- ejs 的else if语句,
- if else语句的优化
- 在llvm中完成if else语句的编译
- 如何在代码中减少if else语句的使用
- IF-ELSE IF-ELSE语句
- if else if与if if语句的区别
- 像素、英寸、厘米的换算
- 如何从Outlook里获得用户的名字和头像
- Android属性之build.prop生成过程分析
- TA数据格式简介
- G20 bid to cut cost of borrowing in eurozone
- 怎样在同时输出if else 里面的语句
- ubuntu 10.04 使能新设备的adb功能
- windbg 使用
- MDK 编译文件大小说明(Program Size)(转)
- c基础部分代码整理
- AJAX异步处理
- POJ 3126 Prime Path 素数+最短路
- CentOS下独立SVN服务器的安装与配置详细过程
- 网络编程基础