我发现了这个错误,我已经搜索了但我没有找到任何相关信息:
/tmp/ccs51ync.o: In function `main':
ccnh7mCr.i :(。text + 0x24):未定义的引用`Main :: class $' collect2:ld返回1退出状态
这是我的代码:
package musique;
import java.util.Scanner;
class Musique {
static String test = "";
public static boolean Double(String n) {
boolean match = false;
for (int i = 0; i < n.length() - 1; i++) {
char last = n.charAt(i);
if (last == n.charAt(i + 1)) {
match = true;
break;
}
}
return match;
}
public static String recursv(String n) {
test = "";
if (Musique.Double(n)) {
for (int i = 0; i < n.length() - 1; i++) {
char last = n.charAt(i);
if (last != n.charAt(i + 1)) {
test += last;
} else {
test += n.substring(i + 2);
System.out.println(test);
break;
}
}
return recursv(Musique.test);
} else {
return n;
}
}
public static void main(String[] args) {
String notes;
Scanner sc = new Scanner(System.in);
notes = sc.nextLine();
System.out.println(Musique.recursv(notes));
}
}