Groovy

 20 Minutes
 10 Questions


This test is designed to assess a student's knowledge of technology, Groovy, and the basics. It will include questions on topics such as programming languages, software development, and web development. The test will also cover Groovy fundamentals such as syntax, classes, and methods. Finally, the test will cover basic concepts related to technology such as hardware components and networking.


Example Question:

Multiple-Choice
Which of the following approaches will fail to iterate a map and print the key and value?
Assume the map contains the following data:
def fruits = [
apple : '0.9$',
orange: '1$',
Apricots : '2$',
Banana: '.5$'
]
Approach A
for (s in fruits) {
println s + ": " + fruits[s]
}
Approach B
fruits.each{ k, v -> println "${k}:${v}" }
Approach C
for ( e in fruits ) {
print "key = ${e.key}, value = ${e.value}"
}