第1个回答 推荐于2016-12-02
public class stringTest {
/**
* @param args the command line arguments
*/
public static void main(String[] args)
{
// TODO code application logic here
int i;
String s="123456789";
int []a=new int[s.length()];
for(i=0;i<s.length();i++)
{
String s0=s.substring(i,i+1);
a[i]=Integer.parseInt(s0);
System.out.println("a"+"["+i+"]"+"="+a[i]);
}
}
}本回答被提问者和网友采纳