This may be a case of semantics but as a practical matter I've been finding that Java absolutely acts sometimes in a pass-by-reference manner as opposed to pass-by-value. For example:
public String example() {
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");
String sResult = "Example:";
GregorianCalendar CAL = new GregorianCalendar(2016, 0, 1); //January 1, 2016
sResult += "\nBegin: CAL = " + f.format(CAL.getTime());
passTo(CAL);
sResult += "\nEnd: CAL = " + f.format(CAL.getTime());
return sResult;
}
public void passTo(GregorianCalendar CAL) {
CAL.add(CAL.DAY_OF_YEAR, 56);
}
Executing example() will result in:
Example:
Begin: CAL = 2016-01-01
End: CAL = 2016-02-26
Clearly, the passTo method has taken the CAL object as an argument, manipulated it, and affected the original object contained within example(). How can anyone argue that only a value was passed if the original object has been altered?
This would fit the definition of pass-by-reference as commonly understood in programming.