Measures Concepts
GitHub icon

Groovy

Groovy - Programming language

< >

Groovy is an open source programming language created in 2003 by James Strachan.

#85on PLDB 21Years Old 76kRepos

Try now: Riju · TIO

Apache Groovy is an object-oriented programming language for the Java platform. It is a dynamic language with features similar to those of Python, Ruby, Perl, and Smalltalk. It can be used as a scripting language for the Java Platform, is dynamically compiled to Java virtual machine (JVM) bytecode, and interoperates with other Java code and libraries. Read more on Wikipedia...


Example from Riju:
print "Hello, world!";
Example from hello-world:
println "Hello World"
// Hello World in Groovy println "Hello World"
Example from Linguist:
#!/usr/bin/env groovy println "Groovy!"
Example from Wikipedia:
class Bird implements FlyingAbility {} /* Adds the trait FlyingAbility to the Bird class capabilities */ def bird = new Bird() /* instantiate a new Bird */ assert bird.fly() == "I'm flying!" /* the Bird class automatically gets the behavior of the FlyingAbility trait */
Groovy Keywords
as assert break case catch class const continue def default do else enum extends false finally for goto if implements import in instanceof interface new null package return super switch this throw throws trait true try while

Language features

Feature Supported Token Example
Conditionals ✓
Inheritance ✓
Switch Statements ✓
Functions ✓
Exceptions ✓
Constants ✓
Classes ✓
While Loops ✓
Booleans ✓ true false
Strings ✓ "
"Hello world"
MultiLine Comments ✓ /* */
/* A comment
*/
Print() Debugging ✓ println
Comments ✓
// A comment
Line Comments ✓ //
// A comment
Operator Overloading ✓
Semantic Indentation X

View source

- Build the next great programming language · Search · Add Language · Features · Creators · Resources · About · Blog · Acknowledgements · Queries · Stats · Sponsor · Day 605 · feedback@pldb.io · Logout