The Dog Class - Java Quiz

21 Questions

Settings
Please wait...
The Dog Class - Java Quiz

This is a multiple choice quiz designed to test your understanding of our introductory Java code. All the questions from this exam are based on the Mr. Hamlin's classroom example of "The Dog Class"


Questions and Answers
  • 1. 
    A good programmer always writes clear comments because it:
    • A. 

      Helps to organize your code.

    • B. 

      Describes your code for other programmers to see.

    • C. 

      Helps you to remember what parts of code did what.

    • D. 

      All of the above

  • 2. 
    Comments are NOT designed to:
    • A. 

      Describe your code to others

    • B. 

      Help you to organize your workflow.

    • C. 

      Be executed by the computer program.

    • D. 

      Help when programming in teams

  • 3. 
    Instance Variables are also known as:
    • A. 

      Methods

    • B. 

      Objects

    • C. 

      Classes

    • D. 

      Fields

  • 4. 
    Choose one of the following options that is NOT a data type.
    • A. 

      Int

    • B. 

      String

    • C. 

      Digit

    • D. 

      Char

  • 5. 
    This is used to create or invoke objects from the class blueprint.
    • A. 

      Instructor

    • B. 

      Parameter

    • C. 

      Constructor

    • D. 

      Variable

  • 6. 
    The 3 types of methods in the Dog Class are:
    • A. 

      Accessor, Mutator, Print / Display

    • B. 

      Renovator, Incubator, Screen

    • C. 

      Action, Reaction, Motivator

    • D. 

      Change, Return, Input

  • 7. 
    You can identify a mutator method by this keyword:
    • A. 

      Get

    • B. 

      Set

    • C. 

      Change

    • D. 

      Mutate

  • 8. 
    You an identify an accessor method by this keyword:
    • A. 

      Set

    • B. 

      Get

    • C. 

      Return

    • D. 

      Display

  • 9. 
    Which data type should always be written with a capitalized first letter?
    • A. 

      Int

    • B. 

      Char

    • C. 

      Boolean

    • D. 

      String

  • 10. 
    Choose the correct way to input your information in to a String variable:
    • A. 

      { information }

    • B. 

      / information /

    • C. 

      ; information ;

    • D. 

      "information"

  • 11. 
    Choose the correct name for the code pictured below:
    • A. 

      Fields

    • B. 

      Comments

    • C. 

      Constructor

    • D. 

      Methods

  • 12. 
    What is the section highlighted in the code below?
    • A. 

      Comment

    • B. 

      Class declaration

    • C. 

      Fields

    • D. 

      Constructor

  • 13. 
    Identify the following section of code:
    • A. 

      Methods

    • B. 

      Constructor

    • C. 

      Comments

    • D. 

      Fields

  • 14. 
    The highlighted text below represents what will become the:
    • A. 

      Objects

    • B. 

      Fields

    • C. 

      Instance Variable

    • D. 

      Data Types

  • 15. 
    What is the following piece of code?
    • A. 

      Display Method

    • B. 

      Mutator Method

    • C. 

      Print Method

    • D. 

      Accessor Method

  • 16. 
    What does the following highlighted section refer to?
    • A. 

      Class

    • B. 

      Object

    • C. 

      Field / Instance Variable

    • D. 

      Data Type

  • 17. 
    What does the following highlighted section of code refer to?
    • A. 

      Object

    • B. 

      Class

    • C. 

      Field / Instance Variable

    • D. 

      Data Type

  • 18. 
    What type of method is shown below?
    • A. 

      Accessor

    • B. 

      Mutator

    • C. 

      Print

    • D. 

      Display

  • 19. 
    What type of method is shown below?
    • A. 

      Accessor

    • B. 

      Mutator

    • C. 

      Return

    • D. 

      Print / Display

  • 20. 
    What will the result be if you were to invoke the following print / display method?
    • A. 

      It will print out the Dog's information on paper

    • B. 

      It will show all of the data entered into the fields on the computer display.

    • C. 

      It will reset all of the information entered into the fields.

    • D. 

      It will allow you to enter new information into the fields.

  • 21. 
    * BONUS QUESTION * Who is the best programming teacher?
    • A. 

      Mr. Spamlin

    • B. 

      Mr. Hamlin

    • C. 

      Mr. Hamalamadingdong

    • D. 

      Mr. Ham Sandwich