A simple example of the range operator is given below. Groovy supports the concept of ranges and provides a notation of range operators with the help of the. This takes modulus using two operands and assigns the result to left operand This divides left operand with the right operand and assigns the result to left operand This multiplies right operand with the left operand and assigns the result to left operand This subtracts right operand from the left operand and assigns the result to left operand This adds right operand to the left operand and assigns the result to left operand. Following are the assignment operators available in Groovy − The Groovy language also provides assignment operators. Here is the truth table showcasing these operators. This is the bitwise “xor” or Exclusive or operator Following are the bitwise operators available in Groovy − Following are the logical operators available in Groovy − Logical operators are used to evaluate Boolean expressions. Following are the relational operators available in Groovy −Ĭhecks to see if the left objects is greater than the right operand.Ĭhecks to see if the left objects is greater than or equal to the right operand. Relational operators allow of the comparison of objects. Incremental operators used to decrement the value of an operand by 1 Incremental operators used to increment the value of an operand by 1 Modulus Operator and remainder of after an integer/float division Following are the Arithmetic operators available in Groovy − The Groovy language supports the normal Arithmetic operators as any the language. Groovy has the following types of operators − An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |