I know that we cannot change the reference passed to a function such as
void fun(dog a){
a=null;
}
After executing the function
main(String[] args){
dog a=new dog();
fun(a);
}
the dog a is not changed. So I was wondering how can we change the reference a to null inside a function