叶0528
public class Demo{
public static void main(String[] args){
String s ="tgjavafgghhgjavahhgfjavaggf";
//统计字符串中有多少JAVA
String[] strArr=s.split("java");
System.out.println("字符串中有多少JAVA:");
System.out.println(strArr.length-1);
//然后将JAVA提换成*
String s1 = s.replaceAll("java","*");
System.out.println("然后将JAVA提换成*: "+s1);
}
}