Home »
Code Examples »
Groovy Code Examples
Groovy - Demonstrate the example of different built-in data types Code Example
The code for Demonstrate the example of different built-in data types
class Example {
static void main(String[] args) {
int int_var = 50;
long long_var = 12345L;
float float_var = 1230.56f;
double double_var = 10.5e40;
BigInteger BigInteger_var = 30g;
BigDecimal BigDecimal_var = 3.5g;
println(int_var);
println(long_var);
println(float_var);
println(double_var);
println(BigInteger_var);
println(BigDecimal_var);
}
}
/*
Output:
50
12345
1230.56
1.05E41
30
3.5
*/
Code by IncludeHelp,
on August 9, 2022 15:28