public class Test6 {
public static void main(String[] args) {
String s = "abc";
s.substring(1);
s.replace("bc", "xyz"); //这句提示错误;错误信息如下,求解!!!
System.out.println(s);
String value = new String ("abc");
System.out.println(s == value);
}
}
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files
The method replace(char, char) in the type String is not applicable for the arguments (String, String)
at com.itheima.Test6.main(Test6.java:25) //25行就是错误行. |