// This appears in Core Web Programming from
// Prentice Hall Publishers, and may be freely used
// or adapted. 1997 Marty Hall, hall@apl.jhu.edu.

// Java 1.1 Only

class Foo {}

class Bar extends Foo {}

public class IsInstance {
  public static void main(String[] args) {
    Foo f = new Foo();
    Bar b = new Bar();
    // Is b an instance of the class f belongs to? (Yes)
    System.out.println(f.getClass().isInstance(b));
  }
}
    

