Skip to content
This repository has been archived by the owner on Jan 1, 2019. It is now read-only.

Commit

Permalink
Create DataTypesExample.groovy
Browse files Browse the repository at this point in the history
  • Loading branch information
haggcoder authored Oct 4, 2017
1 parent 68ce578 commit a3fa7de
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Groovy/DataTypes/DataTypesExample.groovy
Original file line number Diff line number Diff line change
@@ -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
*/

0 comments on commit a3fa7de

Please sign in to comment.