|
||||||
![]() |
Lecture 2 | Slide 13 | 6.837 Fall '98 | ![]() |
We will start by writing what is called a Java applet. This is a form of a Java program that can be imbedded in a HTML document and accessed from the web. An example HTML document that calls the example applet is shown below:
The highlighted lines add the Java code to our document. Notice the .class extension. All Java source code files should end with a .java extension. When a Java program is compiled one or more .class files are generated. Unlike, C and C++ the number of .class files generated by a compile depends on how many objects are defined in the source file. You can get a copy of this HTML file if you like. You might have to change the extension to .html.