Code Listing 1: Logging with system.out.println()

public class ObjectA
{
  private String field1;

  public void setField1(String field1) {
    System.out.println("ObjectA.setField1() called.");
    this.field1 = field1;
  }

  public String getField1() {
    System.out.println("ObjectA.getField1() called.");
    return field1;
  }
}

public class ObjectB
{
  private String field1;

  public void setField1(String field1) {
    System.out.println("ObjectB.setField1() called.");
    this.field1 = field1;
  }

  public String getField1() {
    System.out.println("ObjectB.getField1() called.");
    return field1;
  }
}

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy