package day02;
import java.util.ArrayList;
public class DemoList2 {
public static void main(String[] args) {
// TODO Auto-generated method stub
//多态的写法
ArrayList list = new ArrayList();
//存放三个Point实例到集合中
Point point = new Point(1,2);
list.add(point);
list.add(new Point(3,4));
list.add(new Point(5,6));
System.out.println(list);
}
} |
|