yii框架里怎么把对象转成数组
1个回答
展开全部
例如:
Student s1=new Student("张三","20");
Student s2=new Student("李四","21");
Student s3=new Student("王五","22");
Student s4=new Student("赵六","23");
Student s5=new Student("马奇","24");
Student [] demo={s1,s2,s3,s4,s5};
List<Student> al=new ArrayList<Demo>();
for(int i=0;i<demo.length;i++){
list.add(demo[i]);
Student s1=new Student("张三","20");
Student s2=new Student("李四","21");
Student s3=new Student("王五","22");
Student s4=new Student("赵六","23");
Student s5=new Student("马奇","24");
Student [] demo={s1,s2,s3,s4,s5};
List<Student> al=new ArrayList<Demo>();
for(int i=0;i<demo.length;i++){
list.add(demo[i]);
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询