public class BasicsDemo {
public static void main(
String[] args) {
int sum = 0;
for (int current = 1; current <= 10; current++) {
sum += current;
}
System.out.println("Sum = " + sum);
}
}
The output from this program is:
Sum = 55
I compiled the following prog. and got the following message in appletviewer:
applet not initialized.
This was the following message at the C Prompt:
C:\Program Files\Java>appletviewer BasicsDemo.html
java.lang.ClassCastException: BasicsDemo
at sun.applet.AppletPanel.createApplet(AppletPanel.java:710)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:639)
at sun.applet.AppletPanel.run(AppletPanel.java:319)
at java.lang.Thread.run(Thread.java:595)
Thanks Brent