RosettaCodeData/Task/Copy-a-string/Groovy/copy-a-string-1.groovy
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

3 lines
301 B
Groovy

def string = 'Scooby-doo-bee-doo' // assigns string object to a variable reference
def stringRef = string // assigns another variable reference to the same object
def stringCopy = new String(string) // copies string value into a new object, and assigns to a third variable reference