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

admin2010-12-17  32

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

选项 A、static boolean matches( )     
B、boolean matcher.find( )
C、int matcher.start( )     
D、int matcher.end( )

答案B

解析  Matcher类用于将一个输入字符串input和模式串pattern进行比较。static boolean matches( )方法用于对input和pattern进行比较。boolean matcher.find( )方法用于寻找下一个模式匹配串。int matcher.start( )方法用于寻找下一个起始索引整数值。int matcher.end( )方法用于返回匹配串的一个终止索引整数值。所以正确选项是B。
转载请注明原文地址:https://jikaoti.com/ti/LoH0FFFM
0

最新回复(0)