Displaying Numerical values in Applet

In Applet, we can display numerical values by first converting them into strings and then using the drawString() method of Graphics class. We can do this easily by calling the valueOf() method of String class.

import java.awt.*;
import java.applet.*;
public class temp extends Applet
public void paint (Graphics g)
int x=10;
int y=25;
int add=x+y;
String s="add:"+String.valueOf(add);
g.drawString(s, 100, 100);