diff --git a/Groovy/DataTypes/DataTypesExample.groovy b/Groovy/DataTypes/DataTypesExample.groovy new file mode 100644 index 0000000..d27a667 --- /dev/null +++ b/Groovy/DataTypes/DataTypesExample.groovy @@ -0,0 +1,38 @@ +class Example { + static void main(String[] args) { + //Example of a int datatype + int x = 5; + + //Example of a long datatype + long y = 100L; + + //Example of a floating point datatype + float a = 10.56f; + + //Example of a double datatype + double b = 10.5e40; + + //Example of a BigInteger datatype + BigInteger bi = 30g; + + //Example of a BigDecimal datatype + BigDecimal bd = 3.5g; + + println(x); + println(y); + println(a); + println(b); + println(bi); + println(bd); + } +} + +/* +Output: +5 +100 +10.56 +1.05E41 +30 +3.5 +*/