Copro2 Prefinal Exam

98 Questions | Attempts: 122
Share

SettingsSettingsSettings
Industry Quizzes & Trivia

Java applet


Questions and Answers
  • 1. 

    These are small applications and they are accessed in internet server.

    • A.

      Applications

    • B.

      Applets

    • C.

      Java

    • D.

      Widgets

    Correct Answer
    B. Applets
  • 2. 

    This is the name of the package that you have to import to create and implement your applet code.

    • A.

      Import java.io.*

    • B.

      Import java.applet.*;

    • C.

      Import java.awt.*;

    • D.

      Import java.awt.event.*;

    Correct Answer
    B. Import java.applet.*;
  • 3. 

    This is the name of the package that you have to import to have an action listeners on your program

    • A.

      Import java.io.*;

    • B.

      Import java.applet.*;

    • C.

      Import java.awt.*;

    • D.

      Import java.awt.event.*;

    Correct Answer
    D. Import java.awt.event.*;
  • 4. 

    It can only contain a single line of text and no images.

    • A.

      Label

    • B.

      Button

    • C.

      Textfield

    • D.

      All of these

    Correct Answer
    D. All of these
  • 5. 

    Which of the following is NOT an applet keyword?

    • A.

      Transient

    • B.

      Package

    • C.

      Interface

    • D.

      Gotoxy

    Correct Answer
    D. Gotoxy
  • 6. 

    This is the name of the package that you have to import to create and implement your applet code.

    • A.

      Import java.io.*

    • B.

      Import java.applet.*;

    • C.

      Import java.awt.*;

    • D.

      Import java.awt.event.*;

    Correct Answer
    B. Import java.applet.*;
  • 7. 

    This means that other classes may use this class or method during their execution.

    • A.

      Public

    • B.

      Import

    • C.

      Implement

    • D.

      Package

    Correct Answer
    A. Public
  • 8. 

    It tells Java that this is the beginning of a class declaration.

    • A.

      Public

    • B.

      Void

    • C.

      Class

    • D.

      Static

    Correct Answer
    C. Class
  • 9. 

    This is the name of the package that you have to import to have an action listeners on your program

    • A.

      Import java.io.*;

    • B.

      Import java.applet.*;

    • C.

      Import java.awt.*;

    • D.

      Import java.awt.event.*;

    Correct Answer
    D. Import java.awt.event.*;
  • 10. 

    Which of the following is NOT an applet keyword?

    • A.

      Transient

    • B.

      Package

    • C.

      Interface

    • D.

      Gotoxy

    Correct Answer
    D. Gotoxy
  • 11. 

    Which of the following is the correct declaration of drawing a rectangle method?

    • A.

      G.Drawrect();

    • B.

      G.drawRect();

    • C.

      G.drawingRect();

    • D.

      G.draw_RECT();

    Correct Answer
    B. G.drawRect();
  • 12. 

    Which of the following is the correct parameters of drawString method?

    • A.

      (String, int x, int y)

    • B.

      (String, int y, int x)

    • C.

      (int x, int y, String)

    • D.

      (int x, String, int y)

    Correct Answer
    A. (String, int x, int y)
  • 13. 

    This means that other classes may use this class or method during their execution.

    • A.

      Public

    • B.

      Import

    • C.

      Implement

    • D.

      Package

    Correct Answer
    A. Public
  • 14. 

    The class used to choose color to your drawings

    • A.

      SetColor()

    • B.

      Graphics

    • C.

      Color

    • D.

      Paint

    Correct Answer
    C. Color
  • 15. 

    It tells Java that this is the beginning of a class declaration.

    • A.

      Public

    • B.

      Void

    • C.

      Class

    • D.

      Static

    Correct Answer
    C. Class
  • 16. 

    On the given statement below, which of the following is the location below the upper left corner of the applet window?   g.drawString (“Welcome to Java!”, 140, 50);

    • A.

      ”Welcome to Java!”

    • B.

      140

    • C.

      50

    • D.

      None of these

    Correct Answer
    C. 50
  • 17. 

    Which of the following is the correct declaration of drawing a rectangle method?

    • A.

      G.Drawrect();

    • B.

      G.drawRect();

    • C.

      G.drawingRect();

    • D.

      G.draw_RECT();

    Correct Answer
    B. G.drawRect();
  • 18. 

    The following are methods in Applet class except:

    • A.

      Start()

    • B.

      Stop()

    • C.

      Destroy()

    • D.

      Wait()

    Correct Answer
    D. Wait()
  • 19. 

    Which of the following is the correct parameters of drawString method?

    • A.

      (String, int x, int y)

    • B.

      (String, int y, int x)

    • C.

      (int x, int y, String)

    • D.

      (int x, String, int y)

    Correct Answer
    A. (String, int x, int y)
  • 20. 

    This method literally paints graphical elements in an applet window

    • A.

      Start()

    • B.

      Init()

    • C.

      Draw()

    • D.

      Paint()

    Correct Answer
    D. Paint()
  • 21. 

    The class used to choose color to your drawings

    • A.

      SetColor()

    • B.

      Graphics

    • C.

      Color

    • D.

      Paint

    Correct Answer
    C. Color
  • 22. 

    The correct HTML tag for passing parameters to applet is:

    • A.

    • B.

    • C.

    • D.

    Correct Answer
    A.
  • 23. 

    On the given statement below, which of the following is the location below the upper left corner of the applet window?   g.drawString (“Welcome to Java!”, 140, 50);

    • A.

      ”Welcome to Java!”

    • B.

      140

    • C.

      50

    • D.

      None of these

    Correct Answer
    C. 50
  • 24. 

    Which of the following is the advantage of passing parameters to an applet

    • A.

      It avoids confusion in displaying strings in applet.

    • B.

      You would not need to change and recompile the applet every time you changed the messages.

    • C.

      You would not need to change your html code every time you changed the messages.

    • D.

      It makes your program a lot easier to manage than usual.

    Correct Answer
    B. You would not need to change and recompile the applet every time you changed the messages.
  • 25. 

    The following are methods in Applet class except:

    • A.

      Start()

    • B.

      Stop()

    • C.

      Destroy()

    • D.

      Wait()

    Correct Answer
    D. Wait()
  • 26. 

    This method literally paints graphical elements in an applet window

    • A.

      Start()

    • B.

      Init()

    • C.

      Draw()

    • D.

      Paint()

    Correct Answer
    D. Paint()
  • 27. 

    The _________class “knows” how to change colors and draw things on the screen.

    • A.

      Paint

    • B.

      Color

    • C.

      Draw

    • D.

      Graphics

    Correct Answer
    D. Graphics
  • 28. 

    The correct HTML tag for passing parameters to applet is:

    • A.

    • B.

    • C.

    • D.

    Correct Answer
    A.
  • 29. 

    Which of the following is the correct parameters of fillArc method

    • A.

      (int x, int y, int width, int height, int start angle, int size of angle)

    • B.

      (int x, int y, int width, int height, int size of angle, int end angle)

    • C.

      (int x, int y, int height, int width, int size of angle 1, int size of angle 2)

    • D.

      (int width, int height ,int x, int y, int size of angle 1, int size of angle 2)

    Correct Answer
    A. (int x, int y, int width, int height, int start angle, int size of angle)
  • 30. 

    Which of the following is the advantage of passing parameters to an applet

    • A.

      It avoids confusion in displaying strings in applet.

    • B.

      You would not need to change and recompile the applet every time you changed the messages.

    • C.

      You would not need to change your html code every time you changed the messages.

    • D.

      It makes your program a lot easier to manage than usual.

    Correct Answer
    B. You would not need to change and recompile the applet every time you changed the messages.
  • 31. 

    Which of the following is NOT TRUE regarding parameters of drawRect method?

    • A.

      You can specify whole numbers only

    • B.

      You can declare four parameters only

    • C.

      You can declare negative numbers

    • D.

      You can declare decimal values.

    Correct Answer
    D. You can declare decimal values.
  • 32. 

    The _________class “knows” how to change colors and draw things on the screen.

    • A.

      Paint

    • B.

      Color

    • C.

      Draw

    • D.

      Graphics

    Correct Answer
    D. Graphics
  • 33. 

    To change the color of your drawings, you have to use the method __________.

    • A.

      GetColor()

    • B.

      ChangeColor()

    • C.

      SetColor()

    • D.

      InventColor()

    Correct Answer
    C. SetColor()
  • 34. 

    Which of the following is the correct parameters of fillArc method

    • A.

      (int x, int y, int width, int height, int start angle, int size of angle)

    • B.

      (int x, int y, int width, int height, int size of angle, int end angle)

    • C.

      (int x, int y, int height, int width, int size of angle 1, int size of angle 2)

    • D.

      (int width, int height ,int x, int y, int size of angle 1, int size of angle 2)

    Correct Answer
    A. (int x, int y, int width, int height, int start angle, int size of angle)
  • 35. 

    To create series of lines in your applet, you have to use the method ________.

    • A.

      DrawLinear()

    • B.

      DrawBorder()

    • C.

      DrawLine()

    • D.

      FillLine()

    Correct Answer
    C. DrawLine()
  • 36. 

    Which of the following is NOT TRUE regarding parameters of drawRect method?

    • A.

      You can specify whole numbers only

    • B.

      You can declare four parameters only

    • C.

      You can declare negative numbers

    • D.

      You can declare decimal values.

    Correct Answer
    D. You can declare decimal values.
  • 37. 

    The Component class has the following methods except:

    • A.

      SetBackground()

    • B.

      SetForeground()

    • C.

      SetFont()

    • D.

      SetAlignment()

    Correct Answer
    D. SetAlignment()
  • 38. 

    To change the color of your drawings, you have to use the method __________.

    • A.

      GetColor()

    • B.

      ChangeColor()

    • C.

      SetColor()

    • D.

      InventColor()

    Correct Answer
    C. SetColor()
  • 39. 

    Which of the following is NOT true regarding Button class

    • A.

      It provides a single line of text only.

    • B.

      You cannot change the font style.

    • C.

      You cannot change the font size.

    • D.

      You cannot include background image

    Correct Answer
    C. You cannot change the font size.
  • 40. 

    To create series of lines in your applet, you have to use the method ________.

    • A.

      DrawLinear()

    • B.

      DrawBorder()

    • C.

      DrawLine()

    • D.

      FillLine()

    Correct Answer
    C. DrawLine()
  • 41. 

    Which of the following is NOT a Label constructor?

    • A.

      Label sample = new Label();

    • B.

      Label sample = new Label(“text of label”);

    • C.

      Label sample = new Label(“text of label”, Label.setText());

    • D.

      Label sample = new Label(“text of label”, Label.RIGHT);

    Correct Answer
    C. Label sample = new Label(“text of label”, Label.setText());
  • 42. 

    The Component class has the following methods except:

    • A.

      SetBackground()

    • B.

      SetForeground()

    • C.

      SetFont()

    • D.

      SetAlignment()

    Correct Answer
    D. SetAlignment()
  • 43. 

    It is the listener interface for receiving action events.

    • A.

      ActionEvent

    • B.

      ActionListener

    • C.

      ActionPerformed

    • D.

      ActionImplement

    Correct Answer
    B. ActionListener
  • 44. 

    Which of the following is NOT true regarding Button class

    • A.

      It provides a single line of text only.

    • B.

      You cannot change the font style.

    • C.

      You cannot change the font size.

    • D.

      You cannot include background image

    Correct Answer
    C. You cannot change the font size.
  • 45. 

    This method must be override once you implement an action listener class

    • A.

      AddActionListener

    • B.

      ActionPerformed

    • C.

      ActionEvent

    • D.

      ActionListener

    Correct Answer
    B. ActionPerformed
  • 46. 

    Which of the following is NOT a Label constructor?

    • A.

      Label sample = new Label();

    • B.

      Label sample = new Label(“text of label”);

    • C.

      Label sample = new Label(“text of label”, Label.setText());

    • D.

      Label sample = new Label(“text of label”, Label.RIGHT);

    Correct Answer
    C. Label sample = new Label(“text of label”, Label.setText());
  • 47. 

    It has four constructors that enable one to build the exact object that is needed.

    • A.

      Text class

    • B.

      Textlabel

    • C.

      Textarea

    • D.

      Textfield

    Correct Answer
    D. Textfield
  • 48. 

    The drawString() method is a member of the _____________class.

    • A.

      Graphics

    • B.

      String

    • C.

      Draw

    • D.

      Applet

    Correct Answer
    A. Graphics
  • 49. 

    It is the listener interface for receiving action events.

    • A.

      ActionEvent

    • B.

      ActionListener

    • C.

      ActionPerformed

    • D.

      ActionImplement

    Correct Answer
    B. ActionListener
  • 50. 

    The method that places a value within a previously constructed Textfield is ________.

    • A.

      GetValue

    • B.

      SetText

    • C.

      FillText

    • D.

      SetValue

    Correct Answer
    B. SetText

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Jan 23, 2013
    Quiz Edited by
    ProProfs Editorial Team
  • Mar 01, 2011
    Quiz Created by
    Jhaicee
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.