Groovy web console

subscribe to the feed Subscribe
to this
site
toString vs as String (via #groovywebconsole)
tweet this snippet Tweet
this
script

toString vs as String

Published 2 months ago by Gabriel Bianchi with tags toString as String
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def a = null
String b = a.toString()
String c = a as String
println b
println c
println b instanceof String
println c instanceof String