Java – Short

Java – Short 2017-08-09T12:53:34+00:00

Java Short class :

Java Short class encapsulates a short value. It defines the constants MAX_VALUE and MIN_VALUE and provides the following constructors:

Short(short s)

Short(String str)

EX :


 


Output :
s2 = 32765
s2 = 32766
s2 = 32767
s2 = -32768
s2 = -32767
s2 = -32766
s2 = -32765
s2 = -32764
s2 = -32763
s2 = -32762
s2 = -32761
s1 Object = 2345
Minimum Value of Short = -32768
Maximum Value of Short = 32767
s1* 2 = 4690
s3 Object = 2345
(s1==s3)? true
s4 Object = 16

Prev Next