FileDocCategorySizeDatePackage
ShortCircuit.javaAPI DocExample3136Mon Apr 06 18:10:26 BST 1998None

ShortCircuit

public class ShortCircuit extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    if(test1(0) && test2(2) && test3(2))
      System.out.println("expression is true");
    else
      System.out.println("expression is false");
  
static booleantest1(int val)

    System.out.println("test1(" + val + ")");
    System.out.println("result: " + (val < 1));
    return val < 1;
  
static booleantest2(int val)

    System.out.println("test2(" + val + ")");
    System.out.println("result: " + (val < 2));
    return val < 2;
  
static booleantest3(int val)

    System.out.println("test3(" + val + ")");
    System.out.println("result: " + (val < 3));
    return val < 3;