passing data between controllers

hi,

     i want to pass the data between the controller,

Eg:

def a num = 10 print num end

def b print num end

if i load the b i want to get 10, how to do this? I tried to return the num that dint work. how to do this?