Q: a c++ reference is like a ….. in java?
A: depends (but i'd say it's not like anything in java.)
A1: For a monolithic type like int or char, a c++ reference variable is like a Integer.java variable. Assignment to the reference is like calling a setValue(), though Interger.java doesn't have setValue().
A2: For a class type like Trade, a c++ reference is like nothing in java. When you do refVar2.member3, the reference variable is just like a java variable, but what if you do
The java programmer falls off her chair — this would call the implicit op=