WrapperDemo.java
import java.util.*;
public class WrapperDemo
{
public static void main(String[] args)
{
ArrayList numList = new ArrayList();
numList.add(2006);
int num;
// num = numList.get(0); this won't work
num = (Integer)numList.get(0);
System.out.println(num);
}
}

0 Comments:
Post a Comment
<< Home