What is the purpose of the `matches()` method in Java regular expressions?
A. It splits the input into an array of substrings
B. It replaces the matched text with a new text
C. It searches for the first occurrence of the pattern
D. It checks if the entire input sequence matches the pattern
Answer: Option D

Join The Discussion