Groovy web console

subscribe to the feed Subscribe
to this
site
Contains: Integer vs Long (via #groovywebconsole)
tweet this snippet Tweet
this
script

Contains: Integer vs Long

Published 3 months ago by Marlon França with tags grails
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
List<Integer> citiesId = [13660,13652,13654,13761,13659,13651,13663,13629,13657,13745,13766,13760, 13800, 13817, 13866, 13482]
List<Long> longCitiesId = [13660,13652,13654,13761,13659,13651,13663,13629,13657,13745,13766,13760, 13800, 13817, 13866, 13482]

Integer IntCityId = 13660
Long longCityId = 13660

println citiesId.contains(IntCityId)
println citiesId.contains(longCityId)

println longCitiesId.contains(IntCityId)
println longCitiesId.contains(longCityId)