我是一个Java新手,这是一个真正的基本问题,所以请不要 错过树林。 我只需要知道如何访问从方法如何从Java方法返回后访问返回数据
private static int toInt(String number)
{
int multiplicand = 0;
// do stuff to figure out a multiplicand
return multiplicand;
}
public static void main(String[ ] args)
{
int anotherVariable = 53;
toInt(args[ 0 ]);
所以回来的数据,有什么事我在这里说,我回来后从toInt方法,以便访问是什么被乘数?
可以说我想乘以multiplicand * anotherVariable中返回的内容。 我不能使用被乘数,因为编辑器只是说“不能将多个乘法器解析为变量”。非常感谢所有伟大的程序员耐心地容忍我们的新手。
+1:但有另一个样子,他传递了args [0]这是一个String。 – 2012-08-01 01:21:34
@DonRoby thanx ... – hvgotcodes 2012-08-01 01:22:02
@hvgotcodes - 非常感谢你 – 2012-08-01 02:31:36