不要这样产生变量,会消耗内存,请用数组,会很方便
int randnum[]= new int[100];
for(int i;i<100;i++){
  randnum[i]=i;
}

解决方案 »

  1.   

    呵呵,这好像不能实现的,你可以这样作:
        扩展或使用java.util包中的map,来实现“键-值”对,添加某键为“8”,想获取与其对应的值时,map.getObject("8")即可。
      

  2.   

    too naive***the variable name is meaningless for compiler and end users. It's only for the convenience of your reading codes.
    So you don't need to assign such a "meaningful" name to it.and it's not reasonable.
      

  3.   

    同意mercury1231(我被MM黑了:()
    这样做确实没有什么意义把
      

  4.   

    还是高手厉害,peacock_king(孔雀王)说得对,我也曾想过用Map只是自己初学java怕用不好,所以想听听大家的意见。下午学了一下,还是很好用的,解决了我的问题。谢谢!同时也谢谢ppxstar(胖胖仙) ( ) ,他提了一个很好的建议和心得。今后我会注意的。现在结贴