Example usage for java.lang Integer MAX_VALUE

List of usage examples for java.lang Integer MAX_VALUE

Introduction

In this page you can find the example usage for java.lang Integer MAX_VALUE.

Prototype

int MAX_VALUE

To view the source code for java.lang Integer MAX_VALUE.

Click Source Link

Document

A constant holding the maximum value an int can have, 231-1.

Usage

From source file:Main.java

public static void main(String[] args) {
    System.out.println(Integer.MAX_VALUE);
}

From source file:MainClass.java

public static void main(String[] arg) {
    System.out.println(Integer.MAX_VALUE);

    System.out.println(Integer.MIN_VALUE);

}

From source file:Main.java

public static void main(String[] args) {
    IntSupplier i = () -> Integer.MAX_VALUE;

    System.out.println(i.getAsInt());

}

From source file:Main.java

public static void main(String[] args) {
    System.out.println(Integer.MIN_VALUE);
    System.out.println(Integer.MAX_VALUE);
}

From source file:TimeArray.java

public static void main(String args[]) {
    long startTime = System.currentTimeMillis();
    for (int i = 0, n = Integer.MAX_VALUE; i < n; i++) {
        ;//from   w w  w.ja  v  a  2s .c  o  m
    }
    long midTime = System.currentTimeMillis();
    for (int i = Integer.MAX_VALUE - 1; i >= 0;) {
        ;
    }
    long endTime = System.currentTimeMillis();
    System.out.println("Increasing: " + (midTime - startTime));
    System.out.println("Decreasing: " + (endTime - midTime));
}

From source file:Main.java

public static void main(String[] args) {
    int[] a = new int[10];

    int min = Integer.MAX_VALUE;
    int max = Integer.MIN_VALUE;

    for (int b = 0; b < a.length; b++) {
        a[b] = new Random().nextInt(100);
    }/*from w ww. j a  v a  2 s.c o  m*/

    for (int b = 0; b < a.length; b++) {
        if (a[b] < min)
            min = a[b];
        if (a[b] > max)
            max = a[b];
    }
    System.out.println("Min is: " + min + " " + "Max is: " + max);
}

From source file:TestEnum.java

public static void main(String[] args) {
    for (int y = 0; y < 5; ++y) {
        for (int x = 0; x < Integer.MAX_VALUE; ++x) {
            if (TestEnum.ONE.equals(TestEnum.TWO)) {
                System.out.println("equals");
            }/*ww w. j  a v a2s.com*/
            if (TestEnum.ONE == TestEnum.TWO) {
                System.out.println("==");
            }
        }
    }
}

From source file:Main.java

public static void main(String[] args) {
    ToDoubleFunction<Integer> i = (x) -> Math.sin(x);

    System.out.println(i.applyAsDouble(Integer.MAX_VALUE));
}

From source file:Main.java

public static void main(String args[]) {
    NumberFormat formatter = new DecimalFormat();

    int maxinteger = Integer.MAX_VALUE;

    formatter = new DecimalFormat("0.######E0");
    System.out.println(formatter.format(maxinteger));

}

From source file:Main.java

public static void main(String[] args) {
    ToDoubleBiFunction<Integer, Long> i = (x, y) -> Math.sin(x) + Math.sin(y);

    System.out.println(i.applyAsDouble(Integer.MAX_VALUE, Long.MAX_VALUE));
}