Page 78 - DCAP408_WEB_PROGRAMMING
P. 78
Web Programming
Notes
Example:
<BODY>
The process of writing Java file names must be the file extension is <SAMP> .java <SAMP>.
</BODY>
…..is rendered similar to…..
Notes The <SAMP> element is rendered in a fixed width font. The <SAMP> element has a
similar purpose to <CODE> element.
<CODE> Element
The <CODE> element indicates text that is the code for a program. <CODE> is rendered in a
fixed width font.
Example:
<BODY>
<code>
// a simple HelloWorld loop
public class MyHello
{
public static void main(String[] args) throws InterruptedException
{
for (int k=1; k <= 5; k++)
{
System.out.println(“Hello #” + k);
Thread.sleep (1000 /* millisec */);
}
}
}
</code>
72 LOVELY PROFESSIONAL UNIVERSITY