Groovy (language)
Groovy is the name of a Computer programming language directed object intended for the platform Java.
Il constitutes an alternative to the Java language for this platform and is inspired by Python, Ruby and Smalltalk.
It is the object of specification JSR 241.
Groovy uses a syntax very close to Java with accodances and is directly compiled, either with dynamically stolen, or classically with a compiler in Bytecode.
Groovy is integrated quite naturally with the ecosystem Java bus from the point of view of JVM, it does not present a difference: it is Bytecode. It can thus
- use the libraries Java;
- to be used in classes Java.
Main features of the language
Groovy has certain characteristics which differentiates it from the standard Java- lists, maps, and regular expressions nativement supported;
- closings or closures;
- Overload of the operators.
Comparison between Java and Groovy
Here a comparison of Java and Groovy:
Standard Java (Java 5+)
Groovy
Language of beaconing (XML, HTML,…)
One of the notable characteristics of Groovy is its native support of the languages of beaconing such as XML and HTML. This support makes it possible to define and handle by programming several type of structure with a common syntax.
Example:
this Groovy code…
… produced following contents XML:
Other examples
; Hello Worlddef name=' World'; println " Hello $name! "
; To post an ordered list of names transformed into Capital letter
; To post the first seven successive squares of 2
; To define classes user
class To use extends Persson {
String userid
String email
}
def titi = new To use (name: “titi”)
titi.userid = “titi1412”
titi.email = “titi@acme.org”
titi.age = 40
def rominet = new Persson (name: “rominet”, old: 40, sex: “uhum”)
println " He $ {rominet.name}, here $ {titi.name}, an old buddy of promotion. Write me on $ {titi.email}! "
External bonds
- Groovy
- a page of article devoteds to in Groovy
| Random links: | Partizan Belgrade (male volley ball) | Arumana No Kiseki | Fabrice Borer | Honda VF | County of Sheqi | Métal_de_Glam |