MCPcopy Create free account
hub / github.com/DuGuQiuBai/Java / ArrayListTest

Class ArrayListTest

day16/code/day16_JDK5News/src/cn/itcast_01/ArrayListTest.java:8–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6 * ��ArrayList�洢�Զ�����󲢱�����Ҫ����뷺�ͣ�����ʹ�����ַ�ʽ
7 */
8public class ArrayListTest {
9 public static void main(String[] args) {
10 // �������϶���
11 ArrayList<Student> array = new ArrayList<Student>();
12
13 // ����Ԫ��
14 Student s1 = new Student("����", 18);
15 Student s2 = new Student("١���", 20);
16 Student s3 = new Student("����", 19);
17 Student s4 = new Student("������", 21);
18
19 // ����Ԫ��
20 array.add(s1);
21 array.add(s2);
22 array.add(s3);
23 array.add(s4);
24
25 for (Student s : array) {
26 System.out.println(s.getName() + "---" + s.getAge());
27 }
28 }
29}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected