Is it possible to write a swap method in java? these two variables will be primitives.
It‘s not possible, without any objects or arrays. (Java passes stuff by value.)
check here
时间: 2024-12-11 20:02:58
Is it possible to write a swap method in java? these two variables will be primitives.
It‘s not possible, without any objects or arrays. (Java passes stuff by value.)
check here