Amey Ambulgekar wrote:Q2) why in applet program we can't have main() method.? what is main reason for that..??
Joanne
Joanne Neal wrote:
Amey Ambulgekar wrote:Q2) why in applet program we can't have main() method.? what is main reason for that..??
You can have a main method. It just wont be used as the entry point to the program.
It's a long time since I wrote an applet so I can't remember what the entry point is, but I guess that the reason that it is different to an application entry point is something to do with the way the code is run from the browser.
And can you remove the < > from the title please. It is causing an image to be added instead of the text.
and how its is executed.. and where it is define in java.?
Amey Ambulgekar wrote:Q1) The Q is that in java applet program why we give comment to <applet tag> which is used for HTML ?
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Steve

Rob Spoor wrote:Oracle's own appletviewer
Steve Luke wrote:And as for your first question: Why do you put the Applet tag in a comment in the Java Code:
1- You don't have to do that.
2- One reason you might want to do that is that you can copy the Applet tag code and past it into HTML when you are ready to write the web page where the Applet gets run from.
3- I wouldn't be surprised if some IDEs might be able to find the applet tag in the comment and use it to run tests inside the IDE. But that would be an IDE feature not something that would be needed by the language.
my be by Package or it should be in same folder ..? will it give error about applet java program.. that it is not found or something...
Steve
| Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |