An ordered set of instructions. It reads input, follows rules, and produces output.
Workspace
Groovy
JVM scripting Gradle automation and concise backend glue
Definition first
What Groovy means
Groovy is a programming language for writing exact instructions, often used for JVM scripting Gradle automation and concise backend glue. Start with one mental model: input goes through steps and becomes output.
app.groovyRun groovy app.groovyHabit Use it to automate JVM work before designing bigger abstractionsA value is data. A variable is the name you use to hold and reuse that data.
A named piece of work. It takes input, does one job, and can return a result.
Groovy is the place that actually runs code from app.groovy.
First readable code
Program output
entry point output syntax printlnprintln 42
Output 42Language lineage
Groovy family tree
See where Groovy comes from, which languages feel close, and what to learn next.
Zero base path
Question bank
Search before practice
Pick a stage or search across the open programming bank. Jump straight to the matching drill.
Groovy practice 1
Groovy question 1. Choose the statement that matches printing a value.
Groovy practice 2
Groovy question 2. Choose the statement that matches naming a value.
Groovy practice 3
Groovy question 3. Choose the statement that matches reusable function.
Groovy practice 4
Groovy question 4. Choose the statement that matches basic collection.
Groovy practice 5
Groovy question 5. Choose the statement that matches printing a value.
Groovy practice 6
Groovy question 6. Choose the statement that matches naming a value.
Groovy practice 7
Groovy question 7. Choose the statement that matches reusable function.
Groovy practice 8
Groovy question 8. Choose the statement that matches basic collection.
Groovy practice 9
Groovy question 9. Choose the statement that matches printing a value.
Groovy practice 10
Groovy question 10. Choose the statement that matches naming a value.
Groovy practice 11
Groovy question 11. Choose the statement that matches reusable function.
Groovy practice 12
Groovy question 12. Choose the statement that matches basic collection.
Groovy practice 13
Groovy question 13. Choose the statement that matches printing a value.
Groovy practice 14
Groovy question 14. Choose the statement that matches naming a value.
Groovy practice 15
Groovy question 15. Choose the statement that matches reusable function.
Groovy practice 16
Groovy question 16. Choose the statement that matches basic collection.
Groovy practice 17
Groovy question 17. Choose the statement that matches printing a value.
Groovy practice 18
Groovy question 18. Choose the statement that matches naming a value.
Multiple choice
Groovy practice 1
Groovy question 1. Choose the statement that matches printing a value.
println 42
Reference
Patterns for app.groovy
groovy app.groovyentry point output syntax println
Program output
println 42
- Run the smallest file first
- Print one known value
- Check the output before adding more code
variables assignment types def
Values and names
def total = 42 println total
- Give values readable names
- Keep one idea per line while learning
- Trace the value before changing it
function collection List
Functions and collections
def add(a, b) {
a + b
}
def scores = [40, 2]
println scores.size()- Keep functions small
- Return useful values
- Use the common collection before reaching for frameworks