单选题
在匹配器(Matcher)类中,用于输入字符串与模式串比较的方法是( )。
A、
staticbooleanmatches()
B、
booleanmatcher.find()
C、
intmatcher.start()
D、
intmatcher.end()
【正确答案】
A
【答案解析】
Matcher类用于将一个输入字符串input和模式串pattern相比较。用于输入字符串与模式串比较的方法是staticbooleanmatches();booleanmatcher.find()方法用于寻找下一个模式匹配串;intmarcher.start()方法用于寻找下一个起始索引整数值;intmatcher.end()方法用于返回匹配串的一个终止索引整数值。
提交答案
关闭