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

public static void main(String args[]) {
    try {/*from   w  w  w  .  j  a  va  2 s .  com*/

        FileOutputStream fos = new FileOutputStream(args[0]);

        DataOutputStream dos = new DataOutputStream(fos);

        dos.writeBoolean(false);
        dos.writeByte(Byte.MAX_VALUE);
        dos.writeChar('A');
        dos.writeDouble(Double.MAX_VALUE);
        dos.writeFloat(Float.MAX_VALUE);
        dos.writeInt(Integer.MAX_VALUE);
        dos.writeLong(Long.MAX_VALUE);
        dos.writeShort(Short.MAX_VALUE);

        fos.close();
    } catch (Exception e) {
        System.out.println("Exception: " + e);
    }
}

From source file:Main.java

public static void main(String[] args) throws Exception {
    System.out.println("Thread pool size = " + MAX_THREADS);
    ExecutorService executor = Executors.newFixedThreadPool(MAX_THREADS);
    Future previousFuture = null;
    for (int i = 0; i < MAX_THREADS; i++) {
        JobRunnable job = new JobRunnable(i, previousFuture);
        previousFuture = executor.submit(job);
    }/*ww  w  .ja v  a 2 s.  com*/
    executor.shutdown();
    executor.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
    System.out.println("Program done.");
}

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:demo.vmware.app.Locator.java

/**
 * @param args//from   ww  w .  j a  v a 2 s  .  c o  m
 */
public static void main(String[] args) throws Exception {
    String resource[] = { "spring-cache-locator.xml" };
    ClassPathXmlApplicationContext mainContext = new ClassPathXmlApplicationContext(resource, false);
    mainContext.setValidating(true);
    mainContext.refresh();

    Thread.sleep(Long.MAX_VALUE);
}

From source file:demo.vmware.app.DB.java

/**
 * @param args/*w  ww  .j  ava 2s  . c  o  m*/
 */
public static void main(String[] args) throws Exception {
    String resource = ("spring-db.xml");
    ClassPathXmlApplicationContext mainContext = new ClassPathXmlApplicationContext(new String[] { resource },
            false);
    mainContext.setValidating(true);
    mainContext.refresh();

    Thread.sleep(Long.MAX_VALUE);
}

From source file:demo.vmware.app.WanGatewayWritebehind.java

public static void main(String[] args) throws Exception {
    String resource[] = { "spring-cache-gateway-writebehind.xml" };
    ClassPathXmlApplicationContext mainContext = new ClassPathXmlApplicationContext(resource, false);
    mainContext.setValidating(true);//from  w  w  w.  j a  va2 s.c  o m
    mainContext.refresh();

    Thread.sleep(Long.MAX_VALUE);
}

From source file:demo.vmware.app.ClientCq.java

public static void main(String[] args) throws Exception {
    String resource[] = { "spring-cache-client-core.xml", "spring-cache-client-cq-only.xml" };
    ClassPathXmlApplicationContext mainContext = new ClassPathXmlApplicationContext(resource, false);
    mainContext.setValidating(true);//w w w  .  ja  v a2 s .com
    mainContext.refresh();

    LOG.info("awaiting query callback");
    Thread.sleep(Long.MAX_VALUE);

}

From source file:demo.vmware.app.JmxAgent.java

/**
 * @param args/*  w  w w.  j  av a 2s.c  om*/
 */
public static void main(String[] args) throws Exception {
    String resource[] = { "spring-cache-jmxagent.xml" };
    ClassPathXmlApplicationContext mainContext = new ClassPathXmlApplicationContext(resource, false);
    mainContext.setValidating(true);
    mainContext.refresh();
    LOG.debug("Done attempting to start jmx agent");
    Thread.sleep(Long.MAX_VALUE);
}

From source file:ru.itx.service.ServiceApp.java

public static void main(String[] args) throws Exception {
    final ServiceApp serviceApp = new ServiceApp();
    serviceApp.start();//from   w ww. jav  a 2 s  .  c  o m
    Runtime.getRuntime().addShutdownHook(new Thread() {
        public void run() {
            serviceApp.stop();
        }
    });
    Thread.sleep(Long.MAX_VALUE);
}

From source file:MaxVariablesDemo.java

public static void main(String args[]) {

    //integers/*from   w  w  w.  j a v  a2 s  . c  o  m*/
    byte largestByte = Byte.MAX_VALUE;
    short largestShort = Short.MAX_VALUE;
    int largestInteger = Integer.MAX_VALUE;
    long largestLong = Long.MAX_VALUE;

    //real numbers
    float largestFloat = Float.MAX_VALUE;
    double largestDouble = Double.MAX_VALUE;

    //other primitive types
    char aChar = 'S';
    boolean aBoolean = true;

    //Display them all.
    System.out.println("The largest byte value is " + largestByte + ".");
    System.out.println("The largest short value is " + largestShort + ".");
    System.out.println("The largest integer value is " + largestInteger + ".");
    System.out.println("The largest long value is " + largestLong + ".");

    System.out.println("The largest float value is " + largestFloat + ".");
    System.out.println("The largest double value is " + largestDouble + ".");

    if (Character.isUpperCase(aChar)) {
        System.out.println("The character " + aChar + " is uppercase.");
    } else {
        System.out.println("The character " + aChar + " is lowercase.");
    }
    System.out.println("The value of aBoolean is " + aBoolean + ".");
}