How should a minimal Java program look like? [duplicate]
-
31-10-2019 - |
Question
This question already has an answer here:
I wrote the following code:
import java.awt.*;
import java.awt.event.*;
class Party {
public void buildInvite() {
Frame f = new Frame();
Label l = new Label("Party at Tim's");
Button b = new Button("You bet");
Button c = new Button("Shoot me");
Panel p = new Panel();
p.add(l);
} //more code here...
}
I keep getting the following error: Exception in thread "main" java.lang.NoSuchMethodError: main
I've tried to add an additional main (String[] args)
to the code but I still get the same errors.
What additionally I should put in the code and where in the layout should it go?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow