0

I'm trying to run this code in Visual Studio Code where the main class calls a static method from another class, but I get an error.. The menu method calls the options method. I've tried it in Eclipse and it works well.. I don't know if it's a Visual Studio problem that I'm missing

public class MainClass {

    public static void main(String[] args) {

        Interface.menu();   
    }
}
public class Interface {

    //Constructor
    public Interface(){
    }

    //Methods
    public static void menu(){...
        }

    public static void options(){...
    }
}

Error:

 error: cannot find symbol
        Interface.menu();
        ^
  symbol:   variable Interface
SirrMaxi
  • 543
  • 2
  • 6
  • 14
  • interface is a reserved keyword - I'm surprised the compiler will allow a class to be named Interface - either way a very bad practice as is overuse of static methods. – pczeus May 10 '20 at 17:59
  • Are both in the same package/directory? – pczeus May 10 '20 at 18:00

0 Answers0