All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.pdx.cs.joy.lang.StaticImports Maven / Gradle / Ivy

The newest version!
package edu.pdx.cs.joy.lang;

import static java.lang.Integer.*;
import static java.lang.System.*;

/**
 * Demonstrates J2SE's "static import" facility.
 *
 * @author David Whitlock
 * @version $Revision: 1.1 $
 * @since Summer 2004
 */
public class StaticImports {

  /**
   * Prints the sum of the integers entered on the command line
   */
  public static void main(String[] args) {
    int sum = 0;
    for (int i = 0; i < args.length; i++) {
      sum += parseInt(args[i]); // Integer.parseInt()
    }

    out.println("Sum is " + sum); // System.out
    out.println("MAX_INT is " + MAX_VALUE); // Integer.MAX_VALUE
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy