Both languages are strictly pass by value. Java pretty much uses pointers (references in name only) and primitives only, and both languages copies these all by value. For actual reference you have to go to c++.
For intro computer science students, pointers-as-explicit-references are far easier to comprehend than Java's esoterica.
Said as someone who took intro computer science at 2 universities across 3 courses (C/C++, Python, Java), due engineering to art to computer science major switching.
I understand why Java did what they did, from a performance standpoint, but that's a poor highest value to hold for education use.
And in retrospect, was batshit user-hostile. F.ex. with a few more keywords and rules, C# smoothed off so many rough edges.
> pointers-as-explicit-references are far easier to comprehend than Java's esoterica.
What is esoteric about Java’s references? They are basically equivalent to C pointers without arithmetics and marketed as references. It is pretty much the same for most high level languages.
Yes, int vs Integer. It does make sense that those would function differently. /s ;)
And C definitely has some inscrutable errors, but to me once I understood them, they always made sense in computer terms. Whereas Java errors and oddities only make sense in Java terms.