- class YinYong
- {
- YinYong(String name)
- {
- this.name = name;
- }
- String name;
- }
- class ArrayDemo
- {
- public static void main(String[] args)
- {
- YinYong y = new YinYong("zhangsan");
- YinYong y1 = new YinYong("lisi");
- int[] arr = {1,2,3,4}; //这两个数组在初始化是内存是怎么分配的
- YinYong[] yin = {y,y1};
- }
- }
复制代码 |