FileDocCategorySizeDatePackage
SampleGet.javaAPI DocExample1521Tue Dec 12 18:58:50 GMT 2000None

SampleGet

public class SampleGet extends Object

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

      Rectangle r = new Rectangle(100, 325);
      printHeight(r);

   
static voidprintHeight(java.awt.Rectangle r)

      Field heightField;
      Integer heightValue;
      Class c = r.getClass();
      try {
        heightField = c.getField("height");
        heightValue = (Integer) heightField.get(r);
        System.out.println("Height: " + heightValue.toString());
      } catch (NoSuchFieldException e) {
          System.out.println(e);
      } catch (SecurityException e) {
          System.out.println(e);
      } catch (IllegalAccessException e) {
          System.out.println(e);
      }