我现在有两个包:
我想在Boss里面实现对Employee的调用,
Employee.java:
package payroll2; public class Employee { public void move(){ System.out.print("this is employee"); } }
如果想实现对包的调用,可使用import关键字,然后再对调用类的实例化调用里面的方法
Boss.java:
package payroll; import payroll2.Employee; public class Boss { public static void main(String args[]) { new Employee().move(); } }