Groovy web console

subscribe to the feed Subscribe
to this
site

ListCompare

Published 3 weeks ago by MJ
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def list = ['Groovy', 'Grails', 'Gradle']
def stringArray1 = ['Grails', 'Gradle', 'Groovy'] as Object[]

def stringArray2 = ['Groovy', 'Grails', 'Gradle'] as Object[]

println list.equals(stringArray2)
println list == stringArray2
//assert !(list.equals(stringArray1)) // order matters
println stringArray1 == stringArray2