Given int m=10 and n=11, what will be stored in pon execution of the given
statement: int p= m++ + --n* 4+ n-- + ++m %3.
Answers
Answer:
Variables in Groovy can be defined in two ways − using the native syntax for the data type or the next is by using the def keyword. For variable definitions it is mandatory to either provide a type name explicitly or to use "def" in replacement. This is required by the Groovy parser.
There are following basic types of variable in Groovy as explained in the previous chapter −
byte − This is used to represent a byte value. An example is 2.
short − This is used to represent a short number. An example is 10.
int − This is used to represent whole numbers. An example is 1234.
long − This is used to represent a long number. An example is 10000090.
float − This is used to represent 32-bit floating point numbers. An example is 12.34.
double − This is used to represent 64-bit floating point numbers which are longer decimal number representations which may be required at times. An example is 12.3456565.