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

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {

    public static void main(String[] args) {

        try {

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

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

/*
              
run:
 
int
32
-2147483648
2147483647
     
 */

 



answered Dec 10, 2016 by avibootz

Related questions

1 answer 140 views
1 answer 138 views
1 answer 137 views
1 answer 117 views
1 answer 188 views
1 answer 133 views
1 answer 134 views
...