Java applet working without main method?

I ran the Java class, which, extends Applet implements Runnableand apparently, the program can work, but there is no method main. I thought Java applications needed a method mainas an entry point?

+5
source share
4 answers

Java applets have an init method instead of the main one. It:

public void init() {... }
+8
source

, . ( , Java, ), ; / , , , , , , . , , ; .

+4

Java , .

+2

Copied from Google results:

Applets are stand-alone programs that require a third-party tool to run it, which is either a browser with Java support or applets. Therefore, it does not have main (). it is possible to run the program without the main one.

Possible duplicate:
Why don't applets need a main ()?

0
source

All Articles