Files
oop/lab/lab9/Question4/Start.java
2022-04-23 00:21:49 +08:00

18 lines
472 B
Java

/**
* Answer to questions.
*
* - Q4: What happends if you try to use am enhanced for loop?
*
* - A: The original doors will not be replace. When you use for (Door door :
* doors), JVM will copy the value to door (or copy the address). If you set
* door = new Door(), the new door will be assigned to that copied object,
* istead of the object in array.
*
*/
public class Start {
public static void main(String[] args) {
Door.testDoor();
Car.testCar();
}
}