Java Programs
|
Program to create an applet to print
numerical values. |
import java.awt.*;
import java.applet.*;
public class numvalues extends Applet
{
public void paint(Graphics g)
{
int value1=10;
int value2=20;
int sum=value1 + value2;
String s="sum: " + String.valueOf(sum);
g.drawString(s,100,100);
}
}
<HTML>
<APPLET
CODE=numvalues.class
WIDTH=300
HEIGHT=300>
</APPLET>
</HTML>
|
Output: |


If any
of you want to submit your programs and
contribute to site please mail us at:
citysuvidha@gmail.com
Click here to have a look at List of programs
You can download all the programs in a zip file also. For this you have to do one thing. Just register at the citysuvidha forum and start any thread of any topic. Once you start the thread and put your request, admin will automatically send you the desired zip file.