-
What is the length of the application box made by this program?
import java.awt.*;
import java.applet.*;
public class TextApplet extends Applet
{
Graphic gra;
g.drawString("A Simple Applet", 30, 30);
}
-
- 30
- Runtime Error
- Compilation Error
- Default value
- None of these
Correct Option: C
To implement the method drawString we need first need to define abstract method of AWT that is paint() method. Without paint() method we can not define and use drawString or any Graphic class methods.