danielpetisme

Untitled

Dec 6th, 2012
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def nullVariable = null
  2. def emptyString = ''
  3. def zero = 0
  4.  
  5.  if(nullVariable) {
  6.      println 'A null variable is not evaluate to null'
  7.  }
  8.  else {
  9.      println 'A null variable is evaluate to null'
  10.  }
  11.  
  12.  if(emptyString) {
  13.      println 'An empty string is not evaluate to null'
  14.  }
  15.  else {
  16.      println 'An empty string is evaluate to null'
  17.  }
  18.  
  19.  if(zero) {
  20.      println 'zero is not evaluate to null'
  21.  }
  22.  else {
  23.      println 'zero is evaluate to null'
  24.  }
Advertisement
Add Comment
Please, Sign In to add comment