Java: System.out.print main() 错误 | out 需要是一个抽象的对象 class (不是)

Java: System.out.print Error in main() | out needs to be an object in abstract class (not)

https://github.com/AquaSolid/Interactions

找不到符号 符号:变量输出 location: class System // <-- System 是我的摘要 class

 public class Interactions {

/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    // TODO code application logic here
    System.out.println("Welcome to Interactions."); }}

不要创建一个名为 'System' 的 class,我看到你有一个 "System.java"。

给它起个别的名字。

System 是内置的 Java class!

您通过在包中添加系统 class 隐藏了 java.lang.System。这可以通过完整路径引用 java.lang.System 来解决:

 public class Interactions {

/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    // TODO code application logic here
    java.lang.System.out.println("Welcome to Interactions."); }}