Example usage for java.lang Long MAX_VALUE

List of usage examples for java.lang Long MAX_VALUE

Introduction

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

Prototype

long MAX_VALUE

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

Click Source Link

Document

A constant holding the maximum value a long can have, 263-1.

Usage

From source file:Main.java

public static void main(String[] args) {
    LongStream b = LongStream.of(1L, 1L, Long.MAX_VALUE, Long.MIN_VALUE);

    long[] l = b.toArray();
    for (long v : l) {
        System.out.println(v);//from  w  w  w . j a  v  a 2  s.  c  om
    }
}

From source file:Main.java

public static void main(String[] args) {
    LongStream b = LongStream.of(1L, 2L, Long.MAX_VALUE, Long.MIN_VALUE);
    Stream<Long> l = b.boxed();
    l.forEach(System.out::println);
}

From source file:Main.java

public static void main(String[] args) {
    LongStream b = LongStream.of(1L, 2L, Long.MAX_VALUE, Long.MIN_VALUE);
    Spliterator.OfLong o = b.spliterator();

    System.out.println(o.characteristics());
}

From source file:Main.java

public static void main(String[] args) {
    DoubleToLongFunction dl = (x) -> {
        return Long.MAX_VALUE - (long) x;
    };/*from   w  ww  .  j  a  v a 2s  .  c  o m*/
    System.out.println(dl.applyAsLong(3.14));
}

From source file:Main.java

public static void main(String[] args) {
    LongPredicate i = (l) -> l > 0;

    System.out.println(i.test(Long.MAX_VALUE));
}

From source file:Main.java

public static void main(String[] args) {
    LongStream b = LongStream.of(1L, 2L, Long.MAX_VALUE, Long.MIN_VALUE);
    OptionalLong o = b.min();/*from  ww  w  .  j  a v a  2  s .c  o m*/

    if (o.isPresent()) {
        System.out.println(o.getAsLong());
    } else {
        System.out.println("no value");
    }
}

From source file:Main.java

public static void main(String[] args) {
    LongStream b = LongStream.of(1L, 2L, Long.MAX_VALUE, Long.MIN_VALUE);
    OptionalLong o = b.findAny();

    if (o.isPresent()) {
        System.out.println(o.getAsLong());
    } else {//from  w  w w  .j av  a 2 s .co m
        System.out.println("no value");
    }
}

From source file:Main.java

public static void main(String[] args) {
    LongStream b = LongStream.of(1L, 2L, Long.MAX_VALUE, Long.MIN_VALUE);
    OptionalLong o = b.findFirst();

    if (o.isPresent()) {
        System.out.println(o.getAsLong());
    } else {/*from w w w.jav  a 2 s .c  om*/
        System.out.println("no value");
    }
}

From source file:Main.java

public static void main(String[] args) {
    LongStream b = LongStream.of(1L, 2L, Long.MAX_VALUE, Long.MIN_VALUE);
    OptionalLong o = b.max();//from w  w  w  .ja va  2 s  . c om

    if (o.isPresent()) {
        System.out.println(o.getAsLong());
    } else {
        System.out.println("no value");
    }
}

From source file:Main.java

public static void main(String[] args) {
    LongConsumer i = (l) -> System.out.println(l);
    ;
    i.accept(Long.MAX_VALUE);
}