Can not run Classes or Methods
I just created a small project in IntelliJ. I created one class in the src package (FileFilter) but i can not run the method in this class by the run button, becaus it's simply not there. Only the build button is shown.
So I created another class (Main), containing the main method and an empty void method. The class and the main method can be run, but the default method has the same issue I have with my FileFilter class. Also, i can not run one of the methods within the main file.
As you can see, the icon on the left of my FileFilter class doesn't have the green run symbol on it. I asked ChatGPT for help, but rebuilding the project wasn't a helpful solution. Any tips are appreciated. Thank you (and sorry for my English haha, I'm from Germany)
请先登录再写评论。
Please see https://www.jetbrains.com/help/idea/creating-and-running-your-first-java-application.html.
In Java, you can only run the public static void main method.
Yes I got that, but in my main class I can't run any other method I implemented, although both the classes and the methods are public.
Create an instance of your class in the main method to call its methods, like this:
Please use https://stackoverflow.com/ for your generic programming questions that are not specific to the IDE.