A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© qiemo0709 中级黑马   /  2016-3-31 23:17  /  527 人查看  /  0 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

  1. ArrayList<ArrayList<Student>> list = new ArrayList<>();
  2.                 ArrayList<Student> first = new ArrayList<>();
  3.                 first.add(new Student("张三",23));
  4.                 first.add(new Student("里三",77));
  5.                 first.add(new Student("特有",34));
  6.                 first.add(new Student("低非",25));
  7.                
  8.                 ArrayList<Student> second = new  ArrayList<>();
  9.                 second.add(new Student("发个",53));
  10.                 second.add(new Student("发个",53));
  11.                 second.add(new Student("发个",53));
  12.                 second.add(new Student("发个",53));
  13.                
  14.                 list.add(first);
  15.                 list.add(second);
  16.                
  17.                 for(ArrayList<Student> a : list){
  18.                         for(Person p : a){
  19.                                 System.out.println(p);
  20.                         }
  21.                 }
复制代码

0 个回复

您需要登录后才可以回帖 登录 | 加入黑马