
private static void method(int a,int b){
System.out.println("a=100");
System.out.println("b=100");
System.exit(0);
}
private static void method2(int a,int b){
System.setOut(new PrintStream(System.out){
@Override
public void println(String x) {
if("a=10".equals(x)) {
super.println("a=100");
}else if("b=10".equals(x)){
super.println("b=100");
}else
super.println(x);
}
});
}
private static void method3(Integer a,Integer b) throws Exception {
changValue(a,100);
changValue(b,100);
}
private static void changValue(Integer i,int value) throws Exception{
Field field = Integer.class.getDeclaredField("value");
field.setAccessible(true);
field.set(i,value);
}