class RefA { public Object A; }

void method(RefA ref) {
    Object b  new Object();
    ref.A = b;
}