package com.itheima;
import java.util.ArrayList;
/*
*
* 1、ArrayList<Integer> list = new ArrayList<Integer>(); 在这个泛型为Integer的ArrayList中存放一个String类型的对象。
*
*
* */
public class Test1 {
public static void main(String[] args) {
ArrayList<Integer> arr = new ArrayList<Integer>();
String s = "99";
Integer i = new Integer(s);
arr.add(i);
for (int j = 0; j < arr.size(); j++) {
System.out.println(arr.get(j));
}
}
}
|
|