1 public class Car {
2 private static Car car =
new Car();
3 /**
4 * 多例,getInstance()取出里面一个,(jdbc,连接池)
5 private static List<Car> cars = new ArrayList<Car>();
6 */
7 private Car() {}
8 public static Car getInstance() {
9 return car;
10 }
11 }
转载于:https://www.cnblogs.com/hengzhezou/p/11204279.html
转载请注明原文地址: https://win8.8miu.com/read-21310.html