русский
Germany.ruForen → Архив Досок→ Computer & Co

Что-то ява стала быстро работать

13.01.04 15:03
HELP!
 
Rizaja Bestija завсегдатай
Rizaja Bestija
in Antwort Findеr 11.01.04 23:22
Rebjata ja znaju chto ja tut ne v temu soverschenno, no ochenn nuzna pomosch. Kto nibudd znaet kak eto delatt?public interface Matcher {
public boolean find(String item, String line,0);
}
The method find() in the inteface Matcher searchs for a specific string within another string; the method must return true if the former exists in the latter string. For example: myMatcher.find("cat", "The cat in the hat.") is true, but myMatcher.find("dog", "The cat in the hat.") is false.
You are supposed to implement the interface in two ways:
an algorithmic approach by using nested loops and the methods charAt() and length() from the String class to implement the string search operation
a wrapper around the method indexOf() from the String class
Test both implementations with an appropriate test harness. E.g. verify that the following conditions are met:
the empty string is contained in every string
every string is contained in itself
boundry check, e.g. myMatcher.find("a", "abcd") as well as myMatcher.find("d", "abcd") is true
Eto moja domaschnaja rabota po JAVA. Voobscheto ejo segodnja nuzno bilo sdatt. No ja dumaju chto lusche pozdno chem nikogda. Pomogite chem smozete PLEEEAAASE!!!!
 

Sprung zu