assosiative arrays

R

Rune Runnestø

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

Regards
Rune
 
S

Steve Horsley

Rune said:
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
 
B

bugbear

Rune said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top