Which one of the following is a valid declaration of an applet?

Options
- Public class MyApplet extends java.applet.Applet {
- public Applet MyApplet {
- public class MyApplet extends applet implements Runnable {
- public class MyApplet extends java.applet.Applet {


CORRECT ANSWER : public class MyApplet extends java.applet.Applet {

Discussion Board
to confirm the correct ans

why the declaration of is not as:
public class MyApplet extends applet implements Runnable
and reason for it

pooja shelage 01-29-2019 11:35 AM

Declaration

public class MyApplet extends java.applet.Applet { is the right declaration. Java Applet is a Java program written in a special format to have a graphical user interface. The class is called MyApplet. The extends mean that the MyApplet class will not be written entirely by us. Instead, the class begins by already having many methods of another class called Applet. We imported the Applet class from java.applet.Applet, and it is provided as part of the Java language so that a class such as MyApplet does not have to start from scratch. The act of obtaining methods from another class is called inheritance. The class that provides these methods (such as the Applet class) is called the base class, and the new class (such as our MyApplet class) is called the extended class.

Rohit Sharma 09-30-2014 05:28 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement