Watch This Video
//Person.groovy
package Immutable
import groovy.transform.Immutable
import groovy.transform.ToString
@ToString
@Immutable
class Person {
String first
String last
}
//app.groovy
package Immutable
Person p= new Person(first:"Dan",last:"vega")
println p.toString()
p.first ="Andy"
No comments:
Post a Comment
Note: only a member of this blog may post a comment.