万能百科  > 计算机   > 

在匹配器(Matcher)类中,用于寻找下-个模式匹配串的方法是(  )。

2021-07-13   

问题:

[单选] 在匹配器(Matcher)类中,用于寻找下-个模式匹配串的方法是(  )。

A . static boolean matches(  )

B . boolean marcher.find(  )

C . int matcher.start(  )

D . int matcher.end(  )

正确答案:

A

参考解析:

本题考查考生对Java中的匹配器(Matc-her)类的理解。Matcher类用于将-个输入字符串input和模式串pattern相比较。Boolean matcher.find(  )方法用于寻找下-个模式匹配串;int matcher.start(  )方法用于返回匹配串的-个起始索引整数值;int matcher.end(  )方法用于返回匹配串的-个终止索引整数值。而用于输入字符串与模式串比较的方法是static boolean matches(  ),选项A正确。

词条内容仅供参考,如果您需要解决具体问题
(尤其在法律、医学等领域),建议您咨询相关领域专业人士。

标签