- package com.heima;
- import java.util.ArrayList;
- import java.util.Collection;
- public class De_Jzs {
- public static void main(String[] args){
- Collection c = new ArrayList();
- c.add(new Student("zhandssaa",34));
- c.add(new Student("LISI",43));
- c.add(new Student("andy",42));
- Object[] arr = c.toArray();
- for(int i = 0;i < arr.length; i++)
- System.out.println(arr[i]);
-
- }
- }
复制代码 |
|