码迷,mamicode.com
首页 > 编程语言 > 详细

数组在类中的声明与创建

时间:2016-09-17 13:18:14      阅读:123      评论:0      收藏:0      [点我收藏+]

标签:

 1 public class student{
 2     private String name;
 3     ...  
 4 }
 5 
 6 public class TestStudent{
 7   public static void main(String[] args){
 8        //常见的声明
 9       String[] str=new String[3];
10       //同理,创建多个类数组
11       Student[] stu=new Student[3];
12       stu[0]=new Student();
13   }  
14 }    

 

数组在类中的声明与创建

标签:

原文地址:http://www.cnblogs.com/1020182600HENG/p/5878261.html

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