当前位置: 代码迷 >> J2SE >> 小白!关于包的引入
  详细解决方案

小白!关于包的引入

热度:27   发布时间:2016-04-23 20:29:34.0
小白求助!关于包的引入?
代码如下:
import java.util.*;
public class FindGroup
{
public static void main(String[] args){
  Matcher m = Pattern.compile("\\w+")
  .matcher("java is very easy");
  while(m.find()){
   System.out.println(m.group());
  }
  int i = 0;
  while(m.find(i)){
  System.out.print(m.group() + "\t");
   i++ ;
  }
}
}


编译结果如下:



------解决方案--------------------
import java.util.regex.*;
------解决方案--------------------
API查询很简单,只要输入所需要的类就可以;


如果用eclipse的话,可以看一下它的快捷键的使用,我记得导入类的快捷键是Ctrl + shfit + o;
  相关解决方案