日期:2014-05-19  浏览次数:20659 次

如何将 112, 123, 98 这种long 型数据转换为字符串输出啊?
我是想读一个数,转换为字符,然后添加这个字符到当前字符串的开头:
Java code

for(int i =0; ....)
{
                BigInteger temp = greatdecry[i].remainder(BigInteger.valueOf(128));
                String tempstring = String.valueOf((char)temp.longValue()); 
                iString = iString.insert(0, tempstring);
}



但是输出不对,有的字符时对的,有的不对...

------解决方案--------------------
//输入数字,然后每次把这个数字转换成字符串放在所有字符串的前面。
import javax.swing.JOptionPane;
public class test2
{
public static void main(String[] args)
{
String abc= " ";
String a= " ";
while(a!= "stop "){
a=JOptionPane.showInputDialog(null, "请输入数字 ");
abc=a+abc;
JOptionPane.showMessageDialog(null, "当前的值是 "+abc);
}
}
}

------解决方案--------------------
写法没问题啊,请问哪些字符不对呢。。。