Explore BrainMass

Explore BrainMass

    Java Programming

    Not what you're looking for? Search our solutions OR ask your own Custom question.

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    I keep getting this error message java.lang.NoSuchMethodError: main
    Exception in thread "main" . What I am doing wrong?

    public class PersonTwo {

    public String name = "John Smith";

    public String job = "Doctor";

    public void display() {

    System.out.println("My name is " + name + ", I am a " + job);

    }

    }

    © BrainMass Inc. brainmass.com March 4, 2021, 6:03 pm ad1c9bdddf
    https://brainmass.com/computer-science/java/java-programming-25869

    Solution Preview

    This exception is reported when the main method is missing or its signature is incorrect. The correct signature is

    public static void main(String arg[])

    The method signature ...

    $2.49

    ADVERTISEMENT