Consider the below statements. Statement 1 : Matcher class interprets the pattern in a String Statement2:Matcherclassmatchestheregularexpression againstthetextprovided Statement 2 : Matcher class matches the regular expression against the text provided Which of the following is true?
Answer options
A
Statement 1 alone is correct.
B
Both Statement 1 and 2 are incorrect.
C
Statement 2 alone is correct.
D
Both Statement 1 and 2 are correct
Correct answer: Both Statement 1 and 2 are correct
Explanation
Correct answer: Both Statement 1 and 2 are correct.