public class Test
{}

解决方案 »

  1.   

    可能是跟我网速的关系这个题是这样的class  Test
    { String a =  "hk001";
    public static void main(String[] args) 
    {

    for(int i = 0 ;i < 10 ; i++)
    {
    //这里就是我想没循环一次"hk001"就变为hk002,003m,,,,这样 }
    }
    }
      

  2.   

    我简单做了一下:我觉得这个题好像有问题 因为静态方法只能调用静态变量 所以首先把变量修改为静态变量 不知道是否符合楼主的意思 
    public class Test1 {
    static String a = "hk001";
    public static void main(String[] args) {
    for (int i = 0; i < 10; i++) {
    // 这里就是我想没循环一次"hk001"就变为hk002,003m,,,,这样
    if(i>=0 && i<9){
    String temp = a.substring(0,4);
    System.out.println(temp+(i+1));
    }else{
    String temp = a.substring(0,3);
    System.out.println(temp+(i+1));
    }
    }
    }
    }
      

  3.   

    static String a = "hk";
        static String sFormat = "000";
        public static void main(String[] args) {
      

  4.   

    static String a = "hk";
    static String sFormat = "000";
    public static void main(String[] args) {
        DecimalFormat format = new DecimalFormat(sFormat);
        for (int i = 0; i < 10; i++) {
            System.out.println(a+format.format((i+1)));
       }
    }
      

  5.   

    for (int i = 0; i < 10; i++) {
      System.out.printf("%s%03d%s", "hk", i, (i==9)?"\n":", ")
    }
      

  6.   

    public class Test3 {
    static String a="hk001";
    public static void main(String[] args) {
    a=a.substring(0,4);
    int j=0;
    for(int i=0;i<10;i++){
    j++;
    System.out.println(a+j);
    } }}