Intro To Class, Objects And Methods

17 Questions

Settings
Please wait...
Class Quizzes & Trivia

.


Questions and Answers
  • 1. 
    • A. 

      2

    • B. 

      2 or more

    • C. 

      One or more

    • D. 

      0 or 1

  • 2. 
    Which of the following simple types should be used for monetary values?
    • A. 

      Decimal

    • B. 

      Float

    • C. 

      Int

    • D. 

      Double

  • 3. 
    Not all statements that performed tasks are located in method Main. 
    • A. 

      True

    • B. 

      False

  • 4. 
    The int type should be used for monetary amounts. 
    • A. 

      True

    • B. 

      False

  • 5. 
    An object's property can have which of the following accessors?
    • A. 

      Get

    • B. 

      Set

    • C. 

      A and b

    • D. 

      None

  • 6. 
    Which one refers to the data represented by an object's instance variables? 
    • A. 

      Behaviours

    • B. 

      Attributes

    • C. 

      Methods

    • D. 

      Information

  • 7. 
    Each object of class is identical except for the values and references it holds. 
    • A. 

      True

    • B. 

      False

  • 8. 
    Methods always return a value or reference. 
    • A. 

      True

    • B. 

      False

  • 9. 
    Instance variables and local variables both represent the attributes of a class. 
    • A. 

      True

    • B. 

      False

  • 10. 
    In UML class diagrams, the + sign 
    • A. 

      Signifies that the section can be expanded

    • B. 

      Is the public visibility symbol

    • C. 

      Stands for addition

    • D. 

      None of the above

  • 11. 
    • A. 

      Access modifer

    • B. 

      Left brace

    • C. 

      Method name

    • D. 

      Return type

  • 12. 
    Every #C app is composed of at least one: 
    • A. 

      Public method

    • B. 

      Data member

    • C. 

      Public class declaration

    • D. 

      Imported class

  • 13. 
    C# is known as an extensible language because it declares all classes ahead of time.
    • A. 

      True

    • B. 

      False

  • 14. 
    The keyword new is used to create a new method of a class. 
    • A. 

      True

    • B. 

      False

  • 15. 
    Which of the following method headers does the following method call match?
    • A. 

      Action ()

    • B. 

      Action (int x, double y, string z)

    • C. 

      Action (string x, double y, int z)

    • D. 

      Action (string x, int y, double z)

  • 16. 
    • A. 

      + DisplayMessage ()

    • B. 

      + DisplayMessage ( string )

    • C. 

      + DisplayMessage ( courseName: string)

    • D. 

      + DisplayMessage ( courseName )

  • 17. 
    The comma-seperated values specified in a method called are:
    • A. 

      Arguments

    • B. 

      References

    • C. 

      Objects

    • D. 

      Parameters