编译器错误java编译依赖项将重新编译此文件吗?
---People (folder)
------people.java (file)
------Student (folder)
---------student.java (file)
学生。爪哇
import people.*;
public class student {
people p
public student (people p) {
this.p = p; // dependency injection.
}
}
人们。爪哇
public class people {
public people (people p) {
people p = new student(p);
}
}
上面的代码是关于人的。java依赖于学生。java,所以改变了学生。java导致人们自动编译。爪哇
但现在学生是否依赖人呢
人会变。java导致学生自动编译。爪哇
共 (0) 个答案