What is a short | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

What is a short

not sure how this data type is different

25th Oct 2017, 10:45 AM
Morgan Lee
Morgan Lee - avatar
2 Antworten
+ 16
as @ Dev already explained for comparison or more : https://www.tutorialspoint.com/java/java_basic_datatypes.htm
25th Oct 2017, 10:51 AM
P R
P R - avatar
+ 11
Referring from the Java Oracle documentation: The short data type is a 16-bit signed two's complement integer. It has a minimum value of -32,768 and a maximum value of 32,767 (inclusive). As with byte, the same guidelines apply: you can use a short to save memory in large arrays, in situations where the memory savings actually matters.
25th Oct 2017, 10:50 AM
Dev
Dev - avatar