Home / CSE MCQs / JAVA MCQs :: Applets - Java

CSE MCQs :: JAVA MCQs

  1. Which of these functions is called to display the output of an applet?
  2. A.
    display()
    B.
    print()
    C.
    displayApplet()
    D.
    PrintApplet()

  3. Which of these methods can be used to output a sting in an applet?
  4. A.
    display()
    B.
    print()
    C.
    drawString()
    D.
    transient()

  5. What does AWT stands for?
  6. A.
    All Window Tools
    B.
    All Writing Tools
    C.
    Abstract Window Toolkit
    D.
    Abstract Writing Toolkit

  7. Which of these methods is a part of Abstract Window Toolkit (AWT) ?
  8. A.
    display()
    B.
    print()
    C.
    drawString()
    D.
    transient()

  9. Which of these modifiers can be used for a variable so that it can be accessed from any thread or parts of a program?
  10. A.
    transient
    B.
    volatile
    C.
    global
    D.
    No modifier is needed

  11. Which of these operators can be used to get run time information about an object?
  12. A.
    getInfo
    B.
    Info
    C.
    instanceof
    D.
    getinfoof

  13. What is the Message is displayed in the applet made by this program?
    import java.awt.*;
    import java.applet.*;
    public class myapplet extends Applet {
    public void paint(Graphics g) {
    g.drawString("A Simple Applet", 20, 20);    
    }
    }
  14. A.
    A Simple Applet
    B.
    A Simple Applet 20 20
    C.
    Compilation Error
    D.
    Runtime Error

  15. What is the length of the application box made by this program?
    import java.awt.*;
    import java.applet.*;
    public class myapplet extends Applet {
    public void paint(Graphics g) {
    g.drawString("A Simple Applet", 20, 20);    
    }
    }
  16. A.
    20
    B.
    50
    C.
    100
    D.
    System dependent

  17. What is the length of the application box made by this program?
    import java.awt.*;
    import java.applet.*;
    public class myapplet extends Applet {
    Graphic g;
    g.drawString("A Simple Applet", 20, 20);    
    }
  18. A.
    20
    B.
    Default value
    C.
    Compilation Error
    D.
    Runtime Error