Please note, this is a STATIC archive of website www.javatpoint.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
Javatpoint Logo
Javatpoint Logo

Basic syntax in groovy

The following are the conditions applied while writing the groovy program:

  • In groovy, it is not necessary to put a semicolon at the end of the statement like in java.

Example:

Output:

Basic syntax in groovy
  • In groovy, we can print a line without using round brackets

Example:

Output:

Basic syntax in groovy
  • In groovy, double quotes as well as single quotes can be used in a string.

Example:

Output:

Basic syntax in groovy
  • We can have a single line comment as well as a multi-line comment just like in java.

Example:

Output:

Basic syntax in groovy
  • In Groovy, it is not necessary to have a class or the main function.

Example:

Output:

Basic syntax in groovy
Next TopicGroovy Operators





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA