import java.awt.*; import java.applet.*; public class myapplet extends Applet { Graphic g; g.drawString("A Simple Applet",20,20); }
a) 20
b) Default value
c) Compilation Error
d) Runtime Error
import java.awt.*; import java.applet.*; public class myapplet extends Applet { Graphic g; g.drawString("A Simple Applet",20,20); }
a) 20
b) Default value
c) Compilation Error
d) Runtime Error
You must be logged in to post a comment.
c
Explanation: To implement the method drawString we need first need to define abstract method of AWT that is paint() method. Without paint() method we cannot define and use drawString or any Graphic class methods.