错误代码:
- class StringSort3 {
- /**
- * @param args
- */
- static String string="abc";
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- show(1,new String());
- }
- public static void show(int len, String temp) {
- // TODO Auto-generated method stub
- if(len<string.length()){
- for(int i=0;i<string.length();i++){
- if(!temp.contains(string.substring(i,i+1))){
- System.out.print(temp+string.substring(i,i+1)+" ");
- show(len+1, new String(temp+string.substring(i, i+1)));
- }
- }
- }
-
- }
- }
复制代码
错误提示:The method contains(CharSequence) from the type String refers to the missing type
CharSequence
- The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from
required .class files
有人知道原因吗?
|
|