Groovy Language In Java! Trivia Questions Quiz

12 Questions | Total Attempts: 176

SettingsSettingsSettings
Please wait...
Java Quizzes & Trivia

This trivia questions quiz tests your knowledge in Groovy Language in Java! The language is similar to those of Python, Ruby, and Smalltalk and it is quite interesting to study as a programmer. The quiz below is perfectly designed to see just how much you know about using the language. Give it a shot and see how well you will do.


Questions and Answers
  • 1. 
    (Fill in the blank) In Groovy the == operator tests for ______ equality.
  • 2. 
    A Groovy variable can have either a static or a dynamic ____ depending on how it is declared.
  • 3. 
    (T/F) Groovy supports Java's primitive types.
    • A. 

      True

    • B. 

      False

  • 4. 
    Identify the valid Groovy strings below.
    • A. 

      'I\'m a string'

    • B. 

      "I'm a string"

    • C. 

      /I'm a string/

    • D. 

      All of the above

  • 5. 
    The =~ operator and the ==~ operator have the same semantics
    • A. 

      True

    • B. 

      False

  • 6. 
    (T/F) You must set a run-time property (-enableassertions) in Groovy to enable assertion checks.
    • A. 

      True

    • B. 

      False

  • 7. 
    (Fill in the blanks) In order to use variable interpolation within a string, the string must be enclosed in ______ ________.
  • 8. 
    Following the assignment def x = 2/3;  what it the type of variable x?
    • A. 

      Integer

    • B. 

      Rational

    • C. 

      BigInteger

    • D. 

      BigDecimal

  • 9. 
    (T/F) Groovy has a literal form for a map object.
    • A. 

      True

    • B. 

      False

  • 10. 
    (Fill in the blank) In Groovy checked exceptions are translated into ________ exceptions.
  • 11. 
    The best place to look to see how Groovy "fills in the cracks" of the standard Java libraries is to look:
    • A. 

      In the Java Development Kit (JDK) javadoc

    • B. 

      In the Groovy Development Kit (GDK) javadoc

    • C. 

      In the pure Groovy library javadoc

  • 12. 
    Which tool provides a GUI for writing simple Groovy programs?
    • A. 

      Groovysh

    • B. 

      GroovyConsole

    • C. 

      Groovy