go to previous page   go to home page   go to next page

Answer:

Matches

More on matches()

A String object has a matches() method:

public boolean matches(String RE)

returns true if the regular expression RE 
matches the string, returns false otherwise.

throws a PatternSyntaxException if the syntax 
of RE is invalid.

For now, ignore the exceptions that might be thrown. (They are unchecked exceptions, so you don't need to do anything special in your code.) (Of course, your program will halt when one is thrown.)


QUESTION 3:

Are both the string that owns the method and the regular expression String objects?