Copro2 Final Exam

50 Questions | Attempts: 140
Share

SettingsSettingsSettings
Industry Quizzes & Trivia

50 items


Questions and Answers
  • 1. 

    To run a Java ____, you must use either a Web browser or an applet viewer.

    • A.

      Program

    • B.

      Application

    • C.

      Applet

    • D.

      Method

    Correct Answer
    C. Applet
  • 2. 

    Consider the following program. public class HelloWorld { public static void main(String[] args) {                System.out.print("Hello World ") } } The missing semicolon in the code above will be caught by the ____.

    • A.

      Compiler

    • B.

      assembler

    • C.

      Editor

    • D.

      Run

    Correct Answer
    A. Compiler
  • 3. 

    Which of the following is a reserved word in Java?

    • A.

      Char

    • B.

      CHAR

    • C.

      Char

    • D.

      None of these

    Correct Answer
    A. Char
  • 4. 

    Which package is automatically imported by the Java system?

    • A.

      Java.io

    • B.

      Java.util

    • C.

      Java.lang

    • D.

      Java.applet

    Correct Answer
    C. Java.lang
  • 5. 

    It represents or models things in the real world.

    • A.

      Object

    • B.

      Class

    • C.

      Entity

    • D.

      All of the choices

    Correct Answer
    A. Object
  • 6. 

    It is an event, usually some form of error which happens during the normal course of program execution.

    • A.

      Exception Handling

    • B.

      Error

    • C.

      Exception

    • D.

      Error Handling

    Correct Answer
    C. Exception
  • 7. 

    It is a classification of objects which can’t be touched but do exist.

    • A.

      Tangible objects

    • B.

      Physical

    • C.

      Conceptual

    • D.

      Logical

    Correct Answer
    C. Conceptual
  • 8. 

    Which of the following statements describe the key aspects about the syntax of the try-catch-finally blocks? I.          The block notation is mandatory. II.         For each try block, there can be one or more catch blocks, but at most only one finally block. III.       A try block must be followed by atleast one catch block or one finally block. IV.       Each catch block can define one or more exception handle. V.        The exception must be of the Throwable class or one of its subclasses.

    • A.

      I, III and IV only

    • B.

      II, III and V only

    • C.

      I, II, III and V only

    • D.

      All of the choices

    Correct Answer
    C. I, II, III and V only
  • 9. 

    It refers to the hiding of attributes and methods within an object.

    • A.

      Information Hiding

    • B.

      Encapsulation

    • C.

      Abstraction

    • D.

      Inheritance

    Correct Answer
    B. Encapsulation
  • 10. 

    Which of the following are NOT an example of a Physical object?I.       Person II.     Course III.    Teacher IV.    Department V.     Professor

    • A.

      I, II and V

    • B.

      I, III and V only

    • C.

      II, III and IV only

    • D.

      II and IV only

    Correct Answer
    D. II and IV only
  • 11. 

    This method of Graphics object is useful for drawing  pie-shaped pieces of a circle or oval.

    • A.

      DrawOval( )

    • B.

      FillArc( )

    • C.

      DrawRoundRect( )

    • D.

      DrawCircle( )

    Correct Answer
    B. FillArc( )
  • 12. 

    Which of the following is the method of ActionListener interface?

    • A.

      Public void actionPerformed(ActionEvent e)

    • B.

      Public void actionPerformed( )

    • C.

      ActionPerformed(ActionEvent e)

    • D.

      Public static void actionPerformed( )

    Correct Answer
    B. Public void actionPerformed( )
  • 13. 

    It is the keyword in Java used for instance methods or constructor to refer to the object on which thecurrently executing method has been invoked.

    • A.

      Super

    • B.

      This

    • C.

      Static

    • D.

      Void

    Correct Answer
    B. This
  • 14. 

    Which of the following is NOT a method of MouseListener interface?

    • A.

      MouseMoved()

    • B.

      MouseClicked()

    • C.

      MousePressed()

    • D.

      MouseReleased()

    Correct Answer
    A. MouseMoved()
  • 15. 

    It is a layout manager which divides a rectangular screen area into five regions.

    • A.

      GridBagLayout

    • B.

      BoxLayout

    • C.

      GridLayout

    • D.

      BorderLayout

    Correct Answer
    D. BorderLayout
  • 16. 

    It is the keyword used for implementing an interface.

    • A.

      Extends

    • B.

      Implements

    • C.

      Throws

    • D.

      Import

    Correct Answer
    B. Implements
  • 17. 

     It is an access modifier that specifies that class members are accessible to anyone, both inside outside of the class.

    • A.

      Public

    • B.

      Protected

    • C.

      Private

    • D.

      Default

    Correct Answer
    A. Public
  • 18. 

    It is the process by which an operating system allocates processor time to each running thread.

    • A.

      Thread priority

    • B.

      Thread synchronization

    • C.

      Thread scheduling

    • D.

      Thread time slicing

    Correct Answer
    C. Thread scheduling
  • 19. 

    It is a type of method that is used to write or change the value of  a member field.

    • A.

      Static method

    • B.

      Accessor method

    • C.

      Mutator method

    • D.

      Final method

    Correct Answer
    C. Mutator method
  • 20. 

    Which of the following is the correct signature of method drawString()?

    • A.

      DrawString()

    • B.

      DrawString(String str, int x, int y)

    • C.

      DrawString(int x, Sting str, int y)

    • D.

      DrawString(int x, int y, String str)

    Correct Answer
    B. DrawString(String str, int x, int y)
  • 21. 

     Which of the following will generate an error:

    • A.

      A drawRect method with 4 parameters.

    • B.

      A fillArc method with 6 parameters.

    • C.

      A fillRoundRect method with 4 parameters

    • D.

      A fillRect method with 4 parameters

    Correct Answer
    C. A fillRoundRect method with 4 parameters
  • 22. 

    A window that is moved or covered is __________.

    • A.

      Destructed

    • B.

      Destroyed

    • C.

      Damaged

    • D.

      Overlapped

    Correct Answer
    C. Damaged
  • 23. 

    The distance values for drawRect are ________.

    • A.

      Measured in pixels

    • B.

      Measured in inches

    • C.

      In decimal places

    • D.

      In float type

    Correct Answer
    A. Measured in pixels
  • 24. 

     To change the color for your drawings, you have to use ______ method.

    • A.

      GetColor

    • B.

      SetColor

    • C.

      DrawColor

    • D.

      FillColor

    Correct Answer
    B. SetColor
  • 25. 

    Which of the following is NOT a subclass of class Component

    • A.

      TextField

    • B.

      Button

    • C.

      Choice

    • D.

      Label

    Correct Answer
    A. TextField
  • 26. 

     It prepares your applet to accept event messages.

    • A.

      Event programming

    • B.

      Event-driven programming

    • C.

      Java applet programming

    • D.

      Java application

    Correct Answer
    B. Event-driven programming
  • 27. 

    You can provide animations in java by combining different methods of drawing and using _______

    • A.

      SetColor

    • B.

      Conditional statements

    • C.

      ActionListener

    • D.

      Loop

    Correct Answer
    D. Loop
  • 28. 

    It is an interface class that aligns your components so that they neither crowd each other nor overlap

    • A.

      Layout

    • B.

      Flow layout

    • C.

      Layout managers

    • D.

      Java layout

    Correct Answer
    C. Layout managers
  • 29. 

     which of the following is NOT a type of layout:

    • A.

      FlowLayout

    • B.

      GridLayout

    • C.

      GridBagLayout

    • D.

      BagLayout

    Correct Answer
    D. BagLayout
  • 30. 

     The GridLayout constructor takes 4 arguments and these are

    • A.

      Left, right, top, bottom

    • B.

      Top, right, bottom, left

    • C.

      Cols, rows, ver, hor

    • D.

      Rows, cols, hor, ver

    Correct Answer
    D. Rows, cols, hor, ver
  • 31. 

    A communication from the outside world to the program that something has occurred

    • A.

      Event handling

    • B.

      Event

    • C.

      Action event

    • D.

      Action performed

    Correct Answer
    B. Event
  • 32. 

    This method means that the mouse leaves the component area.

    • A.

      MouseOut

    • B.

      MouseAway

    • C.

      MouseExited

    • D.

      MouseLeaved

    Correct Answer
    C. MouseExited
  • 33. 

    What is another name for a base class?

    • A.

      Superclass

    • B.

      Derived class

    • C.

      Child class

    • D.

      Hierarchy class

    Correct Answer
    A. Superclass
  • 34. 

         It is a method used by the Thread object to pause for a specified number of milliseconds.

    • A.

      Sleep(int)

    • B.

      Wait(int)

    • C.

      Run()

    • D.

      Stop()

    Correct Answer
    A. Sleep(int)
  • 35. 

    These are serious errors in the Java runtime system

    • A.

      Error

    • B.

      Exception

    • C.

      Runtime Exception

    • D.

      User Exception

    Correct Answer
    A. Error
  • 36. 

    Threads with the same priority are called _________.

    • A.

      Sequence

    • B.

      Thread

    • C.

      Monitor

    • D.

      Peers

    Correct Answer
    D. Peers
  • 37. 

     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();
  • 38. 

    Which of the following statements is true?

    • A.

      Errors are more serious than Exceptions

    • B.

      Exceptions are more serious than Errors

    • C.

      Errors and Exceptions are equally serious

    • D.

      Exceptions and errors are same thing

    Correct Answer
    A. Errors are more serious than Exceptions
  • 39. 

    The file method canWrite returns a _________value.

    • A.

      Integer

    • B.

      Boolean

    • C.

      Object

    • D.

      Void

    Correct Answer
    B. Boolean
  • 40. 

    When you perform an input operation in a java program, you use a ___________.

    • A.

      Pipeline

    • B.

      Channel

    • C.

      Moderator

    • D.

      Stream

    Correct Answer
    D. Stream
  • 41. 

     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
  • 42. 

    What type of exception will you use if your program attempt to divide a value to zero?

    • A.

      NullPointerExcption

    • B.

      ArithmeticException

    • C.

      ArrayIndexOutOfBounds

    • D.

      D. IOExcption

    Correct Answer
    B. ArithmeticException
  • 43. 

    What type of exception will you use if you are trying to access a non-existing index?

    • A.

      NullPointerException

    • B.

      StringIndexOutOfBoundsException

    • C.

      ArrayIndexOutOfBoundsException

    • D.

      IOException

    Correct Answer
    C. ArrayIndexOutOfBoundsException
  • 44. 

    The following are the different constructors that can be used to create File object except?

    • A.

      A. File(String directoryPath)

    • B.

      B. File(String directoryPath, String filename)

    • C.

      C. File(File dirPath, String filename)

    • D.

      D. File(File dirObj, String filename)

    Correct Answer
    C. C. File(File dirPath, String filename)
  • 45. 

    The character streams are used to transfer _______ of characters.

    • A.

      8 bits

    • B.

      8 bytes

    • C.

      16 bits

    • D.

      32 bytes

    Correct Answer
    C. 16 bits
  • 46. 

    ____ are pieces of information that are sent into, or passed to, a method, usually because the method requires the information to perform its task or carry out its purpose.

    • A.

      Applets

    • B.

      Arguments

    • C.

      Methods

    • D.

      Objects

    Correct Answer
    B. Arguments
  • 47. 

      A state of a thread that might be blocked, waiting indefinitely, or waiting for a specified time

    • A.

      Inactive

    • B.

      Interrupted

    • C.

      Wait

    • D.

      New

    Correct Answer
    A. Inactive
  • 48. 

     It acts as a gatekeeper, ensuring that only one thread at a time has access to data.

    • A.

      Blocker

    • B.

      Controller

    • C.

      Monitor

    • D.

      Synchronize

    Correct Answer
    C. Monitor
  • 49. 

      Labels and Buttons are __________.

    • A.

      Components

    • B.

      Containers

    • C.

      Applets

    • D.

      Constituents

    Correct Answer
    A. Components
  • 50. 

    A program that allows you to display HTML documents on your computer screen is a ____________.

    • A.

      Search engine

    • B.

      Compiler

    • C.

      Browser

    • D.

      Server

    Correct Answer
    C. Browser

Quiz Review Timeline +

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

  • Current Version
  • Jul 30, 2011
    Quiz Edited by
    ProProfs Editorial Team
  • Mar 27, 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.