FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 692   



Following is the Groovy program which iterates on a List of Strings and change the case of all elements from Lower Case to Upper Case

class GroovyChangeCaseOfListEmenets {
    static void main(String[] args) {

        def colours = [ 'red', 'green', 'blue' ]

        def newList = colours.collect{ it.toUpperCase() }

        print newList
    }
}

Output

[RED, GREEN, BLUE]



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News