Possible Duplicate:
Java associative-array
I have an array in PHP and I need a way to describe the same kind of array in Java. What’s the equivalence for Java?
<?php
$data = array(
"Artist 1" => array(
"Album 1" => array(
array("id", "title", "genre", "length", "year"),
array("id", "title", "genre", "length", "year"),
array("id", "title", "genre", "length", "year")
),
"Album 2" => array(
array("id", "title", "genre", "length", "year"),
array("id", "title", "genre", "length", "year"),
array("id", "title", "genre", "length", "year")
)
),
"Artist 2" => array(
"Album 1" => array(
array("id", "title", "genre", "length", "year"),
array("id", "title", "genre", "length", "year")
)
)
);
?>
With the updated example I would use
After that I would create an indexes required or even use a database like MySQL or load the data from a plain CSV
Unless there is a good reason to nest the data I would use a composite key
Java, being an Object Orientated language, it is preferable to use Objects to store your data structures where possible.