93
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:
- In groovy, we can print a line without using round brackets
Example:
Output:
- In groovy, double quotes as well as single quotes can be used in a string.
Example:
Output:
- We can have a single line comment as well as a multi-line comment just like in java.
Example:
Output:
- In Groovy, it is not necessary to have a class or the main function.
Example:
Output:
Next TopicGroovy Operators