By: Ash Viewed: 735 times Printer Friendly Format
Question: What is the range of values that can be assigned to a variable of type short?
A. It depends on the underlying hardware.
B. 0 through 216-1
C. 0 through 232-1
D. -21515 through 215-1
E. -231 through 231-1.
Answer:D is correct. The range for a 16-bit short is -215 through 215-1. This range is part of the Java specification, regardless of the underlying hardware.
Most Viewed Articles (in Certification )
Latest Articles (in Certification)
Comment on this tutorial
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews