javadestructuring

Parallel assignment (destructuring) in Java?


Does Java have something similar to Python's [a, b, c] = (1, 2, 3) or PHP's list($a, $b, $c) = array(1, 2, 3)?


Solution

  • Not really. You can do x = y = 0 to set several variables, but not a parallel assignment like Python.