Java Challengers #42 - array, object reference, by value, by reference

preview_player
Показать описание
Do you know if Java passes parameters by reference or by value? What is an array, is it an object? Java passes parameters by value to methods but what are these values? Find out in this challenger!

Get the code of the Java Challengers and run your own tests:

Рекомендации по теме
Комментарии
Автор

Hi Rafa! My answer was "2 4 6 8 10" because I thought the arrays of native variables types were by value and not by reference. So, forgetting arrays, what will it happen if an "int" receives a value from another "int"? Same behavior or in this case is by value?

Thanks for the challenges guy, I appreciate so much your work for the Java Community :)

GustavoSantos