This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes ArrayList / Vector Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "ArrayList / Vector" Watch "ArrayList / Vector" New topic

ArrayList / Vector

Vishal K Patel
Ranch Hand

Joined: Oct 20, 2006
Posts: 43
We know that ArrayList and Vector both are growable array of Objects.
but can we store primitive datatypes in it?
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
No, you cannot store them directly. However, you can add a primitive easily since 1.5 because they can be autoboxed.
I agree. Here's the link:
subject: ArrayList / Vector
It's not a secret anymore!