troubleshooting Question

java "newbie" confused by what seems like garbage collection details

Avatar of vincentk111600
vincentk111600 asked on
Java
3 Comments1 Solution226 ViewsLast Modified:
i am confronted with a method which behaves about like so

public static AType parse(BType bb) {

  /* ... do some stuff  */

  bb = parseBB(bb);

  /* MARK X */

  /* ... do some stuff */

  return parseAA();
}

public static BType parseBB(BType bb) {

  bb = new BType();
 
  bb.field = foo;

  return bb;
}


now at MARK X, bb.field has value foo, however, when i call parse(bb) and then inspect bb.field, it has a value of null. what gives? what do i need to do to make the value of bb.field persist? is that
possible at all?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros