StringBuffer p = new StringBuffer();
System.out.println(xx(p));
System.out.println(Integer.parseInt(p.toString())*200); public static int xx(StringBuffer b) {
int a = 10;
b.append(a);
return a*2;
}
HaHa.. HaHa..
System.out.println(xx(p));
System.out.println(Integer.parseInt(p.toString())*200); public static int xx(StringBuffer b) {
int a = 10;
b.append(a);
return a*2;
}
HaHa.. HaHa..
我觉得不全对。应该是不固定内存的对象变量才可以。
就象helpall() 用StringBuffer对象实现楼主的要求。
但是如果用String对象就不能实现。
呵呵,可能String只是个特例而已了。
class MyInt
{
int value;
public int getValue()
{
return value;
}
public vodi setValue()
{
this.value=value;
}
}public int mytest(MyInt a)
{
a.setValue(10);
return a.getValue()*2;
}
是吗?