home | career | drupal | java | mac | mysql | perl | scala | uml | unix

Groovy example source code file (ChainedAssignmentTest.groovy)

This example Groovy source code file (ChainedAssignmentTest.groovy) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Groovy tags/keywords

chainedassignmenttest, chainedassignmenttest, groovytestcase, groovytestcase

The Groovy ChainedAssignmentTest.groovy source code

package groovy

class ChainedAssignmentTest extends GroovyTestCase {

    def dummy(v) {
        print v
    }

    void testCompare() {
        def i = 123
        def s = "hello"

        def i2
        def i1 = i2 = i;
        assert i1 == 123
        assert i2 == 123

        def s1
        dummy(s1 = s)
        assert s1 == "hello"
    }
}

Other Groovy examples (source code examples)

Here is a short list of links related to this Groovy ChainedAssignmentTest.groovy source code file:

new blog posts

 

Copyright 1998-2013 Alvin Alexander, alvinalexander.com
All Rights Reserved.