Questions tagged as 'paso-por-valor'

3
answers

Does Java support the passing of variables by reference? [duplicate]

When I pass an object to a method using a parameter, the object is passed by value or reference? The doubt comes by this code: int a = 2; cambiar(a); System.out.println(a); public static void cambiar(int c) { c = 10; } In the previou...
asked by 16.02.2016 / 02:54
1
answer

Avoid temporary copies in call to lambdas

I have the following class: class Utf8Writer { struct ZoneData { uint32_t begin; // codepoint inicial. uint32_t end; // codepoint final. }; const ZoneData *findCodepoint( uint32_t cp, FontId fid ); }; const ZoneData *Utf8Writer...
asked by 14.05.2018 / 11:15
2
answers

In Java, arguments are passed by value or by reference?

I always thought that in Java the parameters are passed by reference in the case of objects and by value in the case of primitive types. But there are sites where it is said that all parameters are passed by value, for example, here (in Eng...
asked by 18.12.2015 / 23:12