Bath Arrays
Bath Arrays

Help needed for searching a two dimensional string array?
I am trying to search a two dimensional string array, the one below.
String [][] departments = {{"AU", "Automotive"},
{"CO", "Cosmetics"},
{"CW", "Children's Wear"},
{"EL", "Electronics"},
{"FO", "Food"},
{"FR", "Furniture"},
{"HW", "Hardware"},
{"JE", "Jewelry"},
{"KB", "Kitchen & Bath"},
{"MW", "Men's Wear"},
{"PH", "Pharmacy"},
{"TO", "Toys"},
{"WW", "Women's Wear"}};
I have the user enter a item number (ex. au123). Then I will search the array for the first two letters, if it is not found, I display an error and ask for the item number again. If it is found, I store that item number into another array that I will sort and display later in the program.
I get errors when ever i compile it.
The language is java and sorry about not putting the errors. I played around with the code and the error is different than before. I am wonder how you put a two dimensional array into an ArrayList?
what language is this?
If this is Java, use the java.util.ArrayList class. It'll be alot easier.
If this is C++ (which I think it is)
you should put the errors up.
------------------------
don't put a two dimensional array into an arrayList. make another data structure, a "department" with a key and name field.
You can then use a for each loop on it.
![]() |
2 Detox Foot Bath Arrays Round Stainless Steel Aqua Spa Ionic Cleanse Ion USA | US $14.28 | 10h 16m |
![]() |
10PK Round Detox Arrays Stainless Steel Aqua Spa Ionic Cleanse Foot bath New | US $.99 | 12h 14m |
![]() |
New Pro Dual User Fir Belt LCD Ionic Detox Ion Foot Bath Spa Cleanse Machine | US $177.95 | 14h 34m |
![]() |
New Pro Dual User LCD MP3 Ionic Detox Cell Ion Foot Bath Spa Cleanse Machine | US $109.99 | 15h 31m |
![]() |
NEW 200 Watt Solar Panel RV Home Remote Charge Battery HUGE 200w eco charger | US $1.25 | 21h 55m |
![]() |
ION IONIC DETOX FOOT BATH SPA CLEANSE FIR | US $143.95 | 1d 10h 13m |
![]() |
Dual Ionic Detox Foot Bath System 5 Modes with Mp3 and Case | US $.99 | 6d 14h 34m |






