1>数组的赋值操作符= 其实就是将数组A的引用复制一份给了数组B。数组B操作发生的变化都将会应用到数组A

    2>基本类型的数组的初始化是其默认值,对于引用类型来说,创建的数组仅仅是一个引用数组,此时并不会执行任何操作。直到为数组中的元素进行赋值的时候,一系列的初始化动作才会开始。

    1. class Mobile{
    2. Mobile(int marker) {
    3. System.out.println("Mobile(" + marker + ")");
    4. }
    5. }
    6. public class Person {
    7. private Mobile mobile1 = new Mobile(1);
    8. private Mobile mobile2 = new Mobile(2);
    9. private Mobile mobile3 = new Mobile(3);
    10. Person(){
    11. System.out.println("Person()");
    12. }
    13. public static void main(String[] args) {
    14. //此时只是一个引用数组 并没有对其进行初始化的动作
    15. Person[] peoples = new Person[3];
    16. //只有在赋值的时候才会进行初始化
    17. //peoples[0] = new Person();
    18. }
    19. }