View Single Post
Old Dec 1st, 2005, 11:25 PM   #21
andro
Professional Programmer
 
Join Date: Oct 2005
Location: California
Posts: 312
Rep Power: 3 andro is on a distinguished road
Send a message via AIM to andro
Quote:
Originally Posted by titaniumdecoy
No, one is a basic data type and the other is an object.
Yes, but in the context of ArrayList, you cannot specify <int>. You must use <Integer>. You may then use it as a int.

Such as:
myArray.add(5);

if (myArray.get(0) == 5) {
    System.out.println("Yep, it was 5");
}
andro is offline   Reply With Quote