Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Execute Groovy Online

/* Hello World in Groovy */
class Example {
    static void main(String[] args)
    {
        def age = "Dog";
        age = 40;
        '''println("Addition : = " +(5.2.plus(4.4)));
        println("Addition : = " +(5.2.minus(4.4)));
        println("Addition : = " +(5.2.multiply(4.4)));
        println("Addition : = " +(5.2 / 4));
        println("age : = " + (++age));
        println("age : = " + (age++));
        println("age : = " + (age--));
        println("age : = " + (--age));
        println("Biggest Int = " + Integer.MAX_VALUE);
        println("Biggest Float = " + Float.MAX_VALUE);
        println("Biggest Int = " + Integer.MIN_VALUE);
        println("Biggest Float = " + Float.MAX_VALUE);
        println("Biggest Int = " + Double.MAX_VALUE);
         println("Biggest Int = " + Double.MIN_VALUE);'''
         def redomNum = 2.0;
    }
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.