|
||
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi, been having trouble with the last two methods of an assignment.
Basically I need to search an arraylist for a string that matches for example, 'waterford' and print to screen each of these results. Also we need to print to screen an address, based on a name being entered. What would be the best way to implement this, and would HashMap or HashSet be better? We've been thinking along the lines of this Java Code
public void searchByCounty()
{
int index =0;
boolean found = false;
while(index < addressLine.size() && !found)
{
String county = nam.get(index);
if(Address.contains(searchString))
{
found = true;
}
else
{
index++;
}
}
}
|
| The Following User Says Thank You to copeg For This Useful Post: | ||
Espressoul (26-02-2010) | ||
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| searching a string | dvsumosize | What's Wrong With My Code? | 1 | 23-02-2010 05:31 AM |
| How to print results to screen | NinjaLink | What's Wrong With My Code? | 1 | 19-02-2010 05:46 PM |
| Football Results | RSYR | What's Wrong With My Code? | 2 | 04-11-2009 11:24 PM |
| [SOLVED] Extracting an How to ArrayList from an ArrayList and convert to int?? | igniteflow | Collections and Generics | 2 | 16-08-2009 06:11 PM |
| How to use an ArrayList - java.util.ArrayList | JavaPF | Java Code Snippets and Tutorials | 1 | 17-05-2009 06:12 PM |
|
100 most searched terms
Search Cloud
|
| 2 dimensional arraylist java 2d arraylist java actionlistener actionlistener in java addactionlistener addactionlistener java convert double to integer java double format java double to integer in java double to integer java drag en drop programmeren java eclipse shortcut keys exception in thread "awt-eventqueue-0" java.lang.outofmemoryerror: java heap space exception in thread "main" java.lang.nullpointerexception exception in thread "main" java.lang.outofmemoryerror: java heap space format double in java format double java get mouse position java java 2d arraylist java actionlistener java double format java double formatting java double to int java double to integer java format double java forum java forums java get mouse position java list to map java mouse position java programming forum java programming forums java programming practice problems java send keystrokes to another application java two dimensional arraylist java.io.ioexception: premature eof java.lang.classformaterror: truncated class file java.lang.outofmemoryerror: java heap space java.util.arraylist jbutton action jbutton actionlistener jtextarea font jtextfield font size jxl.read.biff.biffexception: unable to recognize ole stream programming mutators and generics smack api two dimensional arraylist two dimensional arraylist java unable to sendviapost to url what is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? |