Example usage for java.lang Long MIN_VALUE

List of usage examples for java.lang Long MIN_VALUE

Introduction

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

Prototype

long MIN_VALUE

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

Click Source Link

Document

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

Usage

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) {
    LongStream b = LongStream.of(1L, 2L, Long.MAX_VALUE, Long.MIN_VALUE);
    OptionalLong o = b.min();/*from w  w w  .  ja v a2s .  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) {
    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 ww  w .j a va  2s. 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.findFirst();

    if (o.isPresent()) {
        System.out.println(o.getAsLong());
    } else {/* ww w .j a va2s  . c  o  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.max();/*from w w  w  . j  av a 2s . com*/

    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);
    OptionalDouble o = b.average();

    if (o.isPresent()) {
        System.out.println(o.getAsDouble());
    } else {/*from  w  ww . j  a va2s.  c  om*/
        System.out.println("no value");
    }
}

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:GetSerVersUID.java

public static void main(String[] av) throws Exception {

    // First we construct a Class object for the given class
    Class cl = Class.forName("Candidate");

    // Then an ObjectStreamClass for the given class
    ObjectStreamClass ocl = ObjectStreamClass.lookup(cl);

    // And use the ObjectStreamClass to get the Class'
    // unique SerialVersionUID
    System.out.println("For class " + cl);
    System.out.println("static final long serialVersionUID = " + ocl.getSerialVersionUID() + "L;"); // must be long

    // And just for reference...
    System.out.println("(Must range from " + Long.MIN_VALUE + " to " + Long.MAX_VALUE + ".)");
}

From source file:MinVariablesDemo.java

public static void main(String args[]) {

    // integers/*from w  ww .ja v  a2 s .  c  om*/
    byte smallestByte = Byte.MIN_VALUE;
    short smallestShort = Short.MIN_VALUE;
    int smallestInteger = Integer.MIN_VALUE;
    long smallestLong = Long.MIN_VALUE;

    // real numbers
    float smallestFloat = Float.MIN_VALUE;
    double smallestDouble = Double.MIN_VALUE;

    // display them all
    System.out.println("The smallest byte value is " + smallestByte);
    System.out.println("The smallest short value is " + smallestShort);
    System.out.println("The smallest integer value is " + smallestInteger);
    System.out.println("The smallest long value is " + smallestLong);

    System.out.println("The smallest float value is " + smallestFloat);
    System.out.println("The smallest double value is " + smallestDouble);
}

From source file:DataTypePrintTest.java

public static void main(String[] args) {

    Thread objectData = new Thread();
    String stringData = "Java Mania";
    char[] charArrayData = { 'a', 'b', 'c' };
    int integerData = 4;
    long longData = Long.MIN_VALUE;
    float floatData = Float.MAX_VALUE;
    double doubleData = Math.PI;
    boolean booleanData = true;

    System.out.println(objectData);
    System.out.println(stringData);
    System.out.println(charArrayData);
    System.out.println(integerData);
    System.out.println(longData);
    System.out.println(floatData);
    System.out.println(doubleData);
    System.out.println(booleanData);
}