import com.ankyhe.simple;
直接调用

解决方案 »

  1.   

    我试了直接用不行啊,就是把//List l = new List();前面的//去掉,编译器说有错误:
    ---------- Javac ----------
    Vector.java:5: cannot find symbol
    symbol  : class List
    location: class com.ankyhe.simple.Vector
    List i;
                    ^
    1 error
      

  2.   

    你们能不能写一个例子给我,发到我的信箱,[email protected],标题写明java。我一定送上50分。
      

  3.   

    你首先要将com.ankyhe.simple.List编译好并且放在合适的位置(javac命令能找到的位置),
    否则com.ankyhe.simple.Vector无法通过编译。
    一个方法是使用命令行
    >javac List.java Vector.java
    这里两个java程序的顺序无所谓,但是一定要一起编译
    另一个方法是,首先将List.java编译成为List.class,然后将com\ankyhe\simple\List.class连通文件夹结构放在某个CLASSPATH文件夹里,注意文件夹结构,一定要和包名一致。
      

  4.   

    使用IDE工具应该不会出现这个问题。
      

  5.   

    谢谢各位的参与,我采用chanceqw的方法成功了,所以20分给他了。不过仍然谢谢各位大小虾的参与。结贴了!!!
      

  6.   

    import com.ankyhe.simple.List;
    public class Vector{
    public Vector(){
    System.out.println("Simple.Vector!");
                        List l = new List();//现在你想怎样访问都行
                       //怎样在这里访问List呢?
    }
    }
    package com.ankyhe.simple;
    public class List{
    public List(){
    System.out.println("Simple.List!");
    }
    }//楼主给分啦^_^