我和Jcreator有ADT问题

时间:2017-11-01 16:55:18

标签: jcreator

我正在使用Jcreator 我的代码是:

import ADTs.*;

公共类ahad1 {

/**
 * Creates a new instance of <code>ahad1</code>.
 */
public ahad1() {
}

/**
 * @param args the command line arguments
 */
public static void main(String[] args) {

    {
     Array a1 = new Array(20,5);
     int b = a1.getBase();
     int l = a1.getLength();
     System.out.println("Base = " + b + "  " + "Length = " + l);
     System.out.println("The elements of a1 are: ");
     for(int i=b; i<(b+l); ++i)
     {
     a1.put(i, i*4);
     System.out.print(a1.get(i) + " ");
     }
     Array a2 = new Array(20,5);
     a2.assign(a1);
     System.out.println();
     System.out.println("The elements of a2 are: ");
     for(int i=b; i<(b+l); ++i)
     System.out.print(a2.get(i) + " ");
     a1.setBase(10);
     System.out.println();
     System.out.println("The new base is: " + a1.getBase());
     }


      }
      }

但错误显示:

 --------------------Configuration: <Default>--------------------
    C:\Users\Dhman\Desktop\ahad\ahad1.java:9: error: package ADTs does not exist
    import ADTs.*;
   ^
  C:\Users\Dhman\Desktop\ahad\ahad1.java:25: error: cannot find symbol
  Array a1 = new Array(20,5);
  ^
     symbol:   class Array
     location: class ahad1
     C:\Users\Dhman\Desktop\ahad\ahad1.java:25: error: cannot find symbol
     Array a1 = new Array(20,5);
           ^
       symbol:   class Array
       location: class ahad1
     C:\Users\Dhman\Desktop\ahad\ahad1.java:35: error: cannot find symbol
     Array a2 = new Array(20,5);
     ^
      symbol:   class Array
       location: class ahad1
        C:\Users\Dhman\Desktop\ahad\ahad1.java:35: error: cannot find symbol
       Array a2 = new Array(20,5);
           ^
       symbol:   class Array
       location: class ahad1
       5 errors

       Process completed.

1 个答案:

答案 0 :(得分:0)

我如何导入ADT。*
我不能这样做