-4

I have a project that compiles. However, it returns an error message in the subject line.

Error: Main method not found in class, please define the main method as:
public static void main(String[] args)

Any ideas where to edit the public static void main(String[] args) into my java project?

Alex Blasco
  • 793
  • 11
  • 22
qafro
  • 13
  • 5

1 Answers1

1

The main method is a special method that serves as the externally exposed entrance point by which a Java program (Java is not Java Script) can be run. It's declared like this:

public class MyClass {
    public static void main(String[] args) {
        System.out.println("Look - I wrote some Java code!");
    }
}

You should seriously take a look at this.

dgg
  • 164
  • 1
  • 10