Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2005

Tip: Looking for answers? Try searching our database.

assosiative arrays

Thread view: 
Rune Runnestø - 16 May 2005 10:10 GMT
Php and Perl have a structure called assosiative arrays. With keys and
values. Does Java have a similar structure ?

Regards
Rune
Alex Buell - 16 May 2005 10:34 GMT
On Mon, 16 May 2005, Rune Runnest wrote:

> Php and Perl have a structure called assosiative arrays. With keys and
> values. Does Java have a similar structure ?

Yes, there's the Map class.

Signature

http://www.munted.org.uk

Drive carefully and find your true love.

--657922-1700622387-1116236071=:13018--

Steve Horsley - 16 May 2005 18:42 GMT
> Php and Perl have a structure called assosiative arrays. With keys and
> values. Does Java have a similar structure ?
>
> Regards
> Rune

See java.util.Map and its subclasses.
You have to use them as classes - there's no special language
support for them, so instead of (python maybe):
    x = properties['WibbleRate']
you must use
    x = properties.get("WibbleRate");

Steve
bugbear - 17 May 2005 10:26 GMT
> Php and Perl have a structure called assosiative arrays. With keys and
> values. Does Java have a similar structure ?

Yes - many kinds of; it even has "associative arrays"
that maintain insertion order, which perl doesn't.

See the MANY implementations of Map, both in
standard Java, and many "collection"
type libraries such as Apache/Jakarta

  BugBear


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.