也就是说我现在有两个类A,B(两个文件)
我现在想调用B.
怎么调用?

解决方案 »

  1.   

    如果a b是在同一个文件里定义的类 那就什么也不用了
    如果a b是在同一个目录里两个不同文件里定义的类 还是什么都不用 
    如果是在不同的目录下 那就只有classpath了 然后还要import
    jbuilder中 属于同一个类? 呵呵 是不是你打错了
      

  2.   

    you meant that the two are in the same java source file? then they can not be in the same class file. So you can do the same process as in the JDK1.3
      

  3.   

    because the two are in the same java source file,so the class file must in the same path,and then,just use it!
      

  4.   

    你有两个类A和B:
    假设两个文件在同一个目录之下,就不需要用import语句引入了.
    直接用象下面这样关联就可以了.
    public class A{
       private B b = new B();
       ...
    }假设两个文件不在同一下目录之下,就需要用import语句引入了.
    import 完整路径.B;
    public class A{
       private B b = new B();
       ...
    }