Create a new linearFind method in the Searcher class that works on any object of the type Comparable and takes a List of Comparable objects.
What will be an ideal response?
```
/**
* Implement a l i n e a r s ear ch through the l i s t of
* comparable o b j e c t s
* @param t a r g e t the o b j e c t you are l o o k i n g f o r
* @param l i s t the l i s t o f comparable o b j e c t s to l o o k in
**/
public s tat ic Comparable l ine a rFind (Comparable targe t ,
Li s t
{
for ( int index=0; index < l i s t . s i z e ( ) ; index++)
{
i f ( t a r g e t . compareTo ( l i s t . ge t ( index ) ) == 0)
freturn ( "Found i t ! " ) ; g
}
return ( "Not found" ) ;
}
```
You might also like to view...
Method________returns a tuple containing the next row in a result set stored in a Cursor object.
a) fetchnext. b) fetchall. c) fetchone. d) None of the above.
Which of the following statements about regular expressions is true?
a. They are used to match specific character patterns in text. b. They can be used to replace parts of one string with another, or to split a string. c. They can be used to validate data to ensure that it’s in a particular format. d. All of the above statements are true.