How to get the size, min and max of Short Data Type in Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {

    public static void main(String[] args) {

        try {

            System.out.println(Short.TYPE);
            System.out.println(Short.SIZE);
            System.out.println(Short.MIN_VALUE);
            System.out.println(Short.MAX_VALUE);

        } catch (Exception e) {
            System.out.println(e.toString());
        }
    }
}

/*
              
run:
 
short
16
-32768
32767
     
 */

 



answered Dec 9, 2016 by avibootz

Related questions

1 answer 249 views
1 answer 221 views
1 answer 241 views
1 answer 237 views
1 answer 195 views
1 answer 169 views
...