Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
> Hi all, Since I don�t have a database, I have created an array using hashmap. I have put some values into each element of the maparray for example: SSN, First Name, Last Name etc. How do I find out the matching map from the maparray using the SSN with each of the array element�s SSN and return the map?? What exactly is it that you're trying to do? If I were going to store a series of Strings that corrosponded with an SSN String, I would create a Map of Maps. The key for the first Map would be the SSN, which would allow you to get the Map containing the info for that SSN. From that Map you can pull out the desired info based on static Strings you're using to identify particular types of data. Something like this should work for what you want to do, or at least give you an idea. If I've misinterpreted your question, sorry: public class DataStorage { public void putData(String SSN, String dataName, String data) { public String getData(String SSN, String dataName) { Replies: |
Sponsored Links
|