码迷,mamicode.com
首页 > 其他好文 > 详细

面向对象第二章

时间:2018-11-15 21:16:01      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:wan   ESS   --   创建   san   add   out   jms   address   

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

面向对象第二章

标签:wan   ESS   --   创建   san   add   out   jms   address   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!