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) {
    LongPredicate i = (l) -> l > 0;
    LongPredicate j = (l) -> l == 0;

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

From source file:Main.java

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

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

From source file:Main.java

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

    LongUnaryOperator j = (l) -> l / 2;

    System.out.println(i.andThen(j).applyAsLong(Long.MAX_VALUE));
}

From source file:Main.java

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

    LongUnaryOperator j = (l) -> l / 2;

    System.out.println(i.compose(j).applyAsLong(Long.MAX_VALUE));
}

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));
}

From source file:MainClass.java

public static void main(String[] args) {
    System.out.println("Here's Long.MAX_VALUE: " + Long.MAX_VALUE);
    BigInteger bInt = new BigInteger("3419229223372036854775807");
    System.out.println("Here's a bigger number: " + bInt);
    System.out.println("Here it is as a double: " + bInt.doubleValue());
}

From source file:BigNums.java

public static void main(String[] argv) {
    //+//from  w  w  w .  j  a v  a 2  s  . com
    System.out.println("Here's Long.MAX_VALUE: " + Long.MAX_VALUE);
    BigInteger bInt = new BigInteger("3419229223372036854775807");
    System.out.println("Here's a bigger number: " + bInt);
    System.out.println("Here it is as a double: " + bInt.doubleValue());
    //-
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    File file = new File("filename");
    FileChannel channel = new RandomAccessFile(file, "rw").getChannel();

    FileLock lock = channel.lock(0, Long.MAX_VALUE, true);

    lock = channel.tryLock(0, Long.MAX_VALUE, true);

    boolean isShared = lock.isShared();

    lock.release();//www. j a  v a 2s.com

    channel.close();
}

From source file:Main.java

public static void main(String[] args) {
    System.out.println("Byte.MIN = " + Byte.MIN_VALUE);
    System.out.println("Byte.MAX = " + Byte.MAX_VALUE);
    System.out.println("Short.MIN = " + Short.MIN_VALUE);
    System.out.println("Short.MAX = " + Short.MAX_VALUE);
    System.out.println("Integer.MIN = " + Integer.MIN_VALUE);
    System.out.println("Integer.MAX = " + Integer.MAX_VALUE);
    System.out.println("Long.MIN = " + Long.MIN_VALUE);
    System.out.println("Long.MAX = " + Long.MAX_VALUE);
    System.out.println("Float.MIN = " + Float.MIN_VALUE);
    System.out.println("Float.MAX = " + Float.MAX_VALUE);
    System.out.println("Double.MIN = " + Double.MIN_VALUE);
    System.out.println("Double.MAX = " + Double.MAX_VALUE);
}

From source file:cl.sebastian.random.run.App.java

/**
 * @param args the command line arguments
 *///from  www  .  j  a va  2 s  .c om
public static void main(String[] args) {
    // TODO code application logic here
    long numero = RandomUtils.nextLong(1000000000000000000L, Long.MAX_VALUE);
    String aleatoreo = String.format("private static final long serialVersionUID = %dL;", numero);
    System.out.println(aleatoreo);
}