我想将两个字符串变量相乘,并将结果存储在一个新变量中。我该怎么做呢?
我已经尝试做了简单的事情:
String t2 = t1 * m1;错误是*未定义。因此,我尝试添加:
import java.math.'whatever';这并没有修复错误。
发布于 2013-07-01 12:53:47
String t1 = "325486";
String m1 = "7868";
int n1 = Integer.parseInt(t1);
int n2 = Integer.parseInt(m1);
int n3 = n1 * n2;
String t2 = String.format("%d", n3);https://stackoverflow.com/questions/17397286
复制相似问题