Oh, I wish. For example, in C you can easily return multiple values through pointers. In Java, you have no such luxury without allocating so it's even less flexible if you can't allocate.
Oh, I wish. For example, in C you can easily return multiple values through pointers. In Java, you have no such luxury without allocating so it's even less flexible if you can't allocate.
I'd say that Java has similar semantics to C. One can easily pass object references to a function that sets their data. That looks and behaves almost exactly like C. The fact that the references are allocated on the heap is an implementation detail.
Let me be clear, a pointer to a struct on the stack in C is obviously not the same as a reference to an object allocated on the heap in Java. The point is that from the point of view of what the language induces you to do, Java and C are similar. Anyone that has used older libraries in Java can attest to this; they look and feel remarkably like C.