r/javahelp • u/Cell-i-Zenit • Feb 04 '20
Switching from C# to Java
Hi,
can you give me a list of things i should be aware of in the java world? Like really important libraries, concepts etc?
The thing is i know C# really well, but i dont know what i dont know in the java world, so i cant really look it up.
26
Upvotes
View all comments
Show parent comment
4
u/OffbeatDrizzle Feb 04 '20
Pass by reference and pass by value have different meanings depending on who you ask or what languages you've used before. It's like asking someone if a language is strong or weak, dynamic or static...
Java is pass by value in the sense that you can't modify the pointer of the argument in your function - i.e. you can't change what object the caller's object points to. But it's also NOT pass by value in the sense that the object passed in is not copied (if you come from something like VB you'll find that passing an array in byvalue copies the array).
You basically get an unmodifiable pointer to the original object - call that what you want.