danielpetisme

Untitled

Dec 6th, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Person {
  2.   String firstName
  3.   String lastName
  4.  
  5.   def getLastName(){
  6.     lastName.toUpperCase()
  7.   }
  8. }
  9.  
  10. //Constructor with named arguments
  11. def person3 = new Person(firstName: 'Eddard', lastName: 'Stark')
  12. assert "${person3.firstName} ${person3.lastName}" == "Eddard STARK"
Advertisement
Add Comment
Please, Sign In to add comment