03 - Collective Datatypes

10 Questions | Total Attempts: 39

SettingsSettingsSettings
Please wait...
Java Quizzes & Trivia

Quiz for session on Groovy simple and collective data types. Abc


Questions and Answers
  • 1. 
    Groovy enhances the Date class so you can say:Date today = new Date()Date tomorrow = ++today
    • A. 

      True

    • B. 

      False

  • 2. 
    A Groovy List variable has a default implementation from the concrete LinkedList class..
    • A. 

      True

    • B. 

      False

  • 3. 
    Consider the Groovy code: Map m = [:] m.c=3 m.b=2 m.a=1 What is true about the map's key set:
    • A. 

      Its order is 'a', 'b', 'c'

    • B. 

      Its order is 'c', 'b', 'a'

    • C. 

      Its order cannot be determined

  • 4. 
    A new map entry can created by assigning a new "subscript" value within the map, e.g. m["d"] = 4.
    • A. 

      True

    • B. 

      False

  • 5. 
    A map value can only be referenced by dot notation, e.g. m.d
    • A. 

      True

    • B. 

      False

  • 6. 
    A list variable can be tested for its true/false value based on whether all of its elements are null.
    • A. 

      True

    • B. 

      False

  • 7. 
    A map literal implicitly treats its keys as _____ values.
  • 8. 
    A map used in the context of a POGO constructor does not require square bracket delimiters.
    • A. 

      True

    • B. 

      False

  • 9. 
    A range variable (not literal) can be used as a case label within a switch statement.
    • A. 

      True

    • B. 

      False

  • 10. 
    The map method 'get()' with (pick the correct number) x parameters can potentially add a new key/value to the map.
    • A. 

      1

    • B. 

      2

    • C. 

      3

Back to Top Back to top