首页 > 其他 > 详细

面向对象第二章

时间:2018-11-15 20:57:33      阅读:174      评论:0      收藏:0      [点我收藏+]
1.引用类型数组: 1)Student[] stus = new Student[3]; //创建Student数组对象 stus[0] = new Student("zhangsan",25,"LF"); //创建Student对象 stus[1] = new Student("lisi",26,"JMS"); stus[2] = new Student("wangwu",28,"SD"); System.out.println(stus[0].address); 2)Student[] stus = new Student[]{ new Student("zhangsan",25,"LF"), new Student("lisi",26,"JMS"), new Student("wangwu",28,"SD") }; 3)int[][] arr = new int[3][];-----------数组的数组 arr[0] = new int[2]; arr[1] = new int[3]; arr[2] = new int[2]; arr[1][0] = 100; 4)int[][] arr = new int[3][4];----------数组的数组 for(int i=0;i

面向对象第二章

原文:https://www.cnblogs.com/ahaijava/p/9965889.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!