Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Applet runs without a main method?

Tags:

java

main

applet

I was running a Java class that extends Applet implements Runnable and apparently the program can run, but there is no main method. I thought Java applications needs the main method as its entry point?

like image 596
Nicholas Kong Avatar asked Dec 22 '11 22:12

Nicholas Kong


1 Answers

Java Applets have an init method instead of main. It's:

public void init() {... }
like image 191
Fritz Avatar answered Sep 18 '22 12:09

Fritz