This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / 请问:在JAVA中
-ivy_sh(Ivy_sh);
2002-6-12
{537}
(#572646@0)
-
value class
-macsym(日进斗斤);
2002-6-12
(#572650@0)
-
不太明白,能解释下吗?
-ivy_sh(Ivy_sh);
2002-6-12
(#572667@0)
-
I guess: make the method return a class object, and then call the getValue methods of that object to get all return values.
-bloor(不老);
2002-6-12
(#572693@0)
-
right, define a inner class to do this job.
-macsym(日进斗斤);
2002-6-12
(#572713@0)
-
不动脑子的解决办法,把所有返回值放在Vector里面传回去就行乐。
-xanada(㊣流水);
2002-6-12
(#572680@0)
-
对于返回参数是同类型的可以,但如果既有String,又有double,还有boolean怎么办呢?
-ivy_sh(Ivy_sh);
2002-6-12
(#572697@0)
-
谁说只能是同一类型,Vector可什么都能装
-xanada(㊣流水);
2002-6-12
(#572701@0)
-
Thank you,I will try it
-ivy_sh(Ivy_sh);
2002-6-12
(#572725@0)
-
太多方法了,你可以放在 array, vector, list or class 里面....
-eggplant(老茄子);
2002-6-12
(#572689@0)
-
Thank you,I will try
-ivy_sh(Ivy_sh);
2002-6-12
(#572727@0)
-
谢谢,因为JAVA的速度差强人意,所以有时不只考虑实现的方法,还要选个性能好,不浪费资源的.测试中....
-ivy_sh(Ivy_sh);
2002-6-12
(#572735@0)
-
encapsulate primitive type argumentsIf you want to change the values of arguments, you can encapsulate primitive type arguments with related classes. For example:
void myMethod(Integer v1, Double v2) {
//modify the fields of v1, v2
...}
callerMethod() {
int a = 5;
double b = 2.3;
Integer v1 = new Integer(a);
Double v2 = new Double(b);
myMethod(v1, v2);
a = v1.intValue();
b = v2.doubleValue();
}
-jdbees(george);
2002-6-13
{381}
(#575680@0)