In both cases you are passing value only. U pass the value of Object ID into new reference Variable bd which is local in that case.
So when u call
bd.lear=400;
it changes the value of lear variable of the Object.
Now when function finishes , stack is destroyed. So is reference variable bd.
But since main function bd contains id of the object , object is not destroyed.
Coming to primitive type , u changed the value of local variable a of showYear function in this
a=59;
it prints it and is destroyed with stack of the object. But main functions local variable is still present with value 56.
Make a part of Object and then try
bd.a=59;
you will see value changing. Read about Local variables, instance variables and class variables..!