So I am confused. There is a collections class in the main api and a new seperate collections api. What are the different "terms" for these? One is in the main api, how do you say that. One is an add on library, how do say that? If I install the new collections api will all my existing collections code still work? Thanks.
Please ignore post, I have no idea what I am talking about.
Hi Christopher, The java.util.Collection is the parent interface of the collection API. While the java.util.Collectionsclass is a helper class (mostly static methods) to work with Collections. Your collections (mainly Vectors) will continue to work after updating to Java 2 collections API. Regards, Manfred.
So the parent interface java.util.Collection is part of the "standard" api. And the helper class java.util.Collections is an "add on". By "add on" I mean you have to download and install another library. Is that correct? So when I go to the sun site to look at the api, I select "java.util", than I select "Collections". Now is this the "standard" api only? Where do I find the "add on" api? This is what I am talking about when I say add on Thanks.
[This message has been edited by christopher foran (edited November 30, 2001).]
java.util.Collections is part of the standard java 2 API. IT could have been refered to as an add on maybe because it is new in java 1.2 and above. ------------------ Bosun SCJP for the Java� 2 Platform
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Using an example from this article (shown below) it was not working and a coworker told me I had to download an add on library to use collections. But when I changed the include from "java.util.collections.*" to "java.util.*" it started working. Can anyone clear that up for me? Thanks.
Sun did not create a separate directory in their jar structure dedicated to collections. They just mixed them in with the rest of the utils. You can check out where they live in the API documentation. Just click on Collections or any class that implements Collection and look at the heirarchy.
[This message has been edited by Cindy Glass (edited November 30, 2001).]
"JavaRanch, where the deer and the Certified play" - David O'Meara
There is no package named java.util.collections in the current jdk. The code in the article is in error, and your friend is in error.
Ya, I finally figured that out. With
every thing compiled except for the Iterator. Which is one of the reasons I started down the wrong path. My co-worker and the author of that article being the other two reasons. Thanks for the help (as always).