Thread: Short/Integer
View Single Post
  #2 (permalink)  
Old 12-01-2007, 02:02 AM
hardwired's Avatar
hardwired hardwired is offline
Senior Member
 
Join Date: Jul 2007
Posts: 1,577
Rep Power: 4
hardwired is on a distinguished road
Default
Yes, up to the max value for the short data type. Then you have to use int up until you reach its max value. Then you have to use long.
Code:
System.out.printf("max short value = %d%n" +
                          "max int value   = %d%n" +
                          "max long value  = %d%n",
                           Short.MAX_VALUE, Integer.MAX_VALUE,
                           Long.MAX_VALUE);
Reply With Quote