HEADS-project / training

Training material to get started with the HEADS technologies
10 stars 16 forks source link

Better use Java int than short (same for int and long). #72

Closed skorsky closed 9 years ago

skorsky commented 9 years ago

See http://stackoverflow.com/questions/27122610/why-does-the-java-api-use-int-instead-of-short-or-byte.

short x = 1; short y = 2; short z = x + y; // compile error! short z = (short) (x + y); // addition is forces auto boxing to int.