|
Groovy example source code file (VariablePrecedenceTest.groovy)
The Groovy VariablePrecedenceTest.groovy source codepackage groovy.bugs class VariablePrecedenceTest extends GroovyTestCase { def x = 100 def y = 93 def c = {x -> assert x == 1; assert y == 93; } void testFoo() { String[] args = ["a"] main(args) } static void main(args) { def vfoo = new VariablePrecedenceTest() vfoo.c.call(1) def z = 874; 1.times { assert vfoo.x == 100; assert z == 874; z = 39; } assert z == 39; vfoo.local(); } void local() { c.call(1); def z = 874; 1.times { assert x == 100; assert z == 874; z = 39; } assert z == 39; } } Other Groovy examples (source code examples)Here is a short list of links related to this Groovy VariablePrecedenceTest.groovy source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.