Explore BrainMass

Java Programming

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);



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 ...