Top 1,000 Features Creators Events Podcasts Extensions Interviews Blog Explorer CSV

Groovy

< >

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

#61on PLDB 21Years Old 76kRepos
Homepage · REPL · Try It Online · Download · Blog · Wikipedia · Subreddit · Twitter · FAQ · Release Notes · Docs

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 Example Token
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 · About · Resources · Acknowledgements · Part of the World Wide Scroll