Listing B
public class MyTask {

   private int x;
   private String y;

    // 'doIt' method that does some function/task…
    public void doIt() throws SomeException {
        // do something…
    }

    // Properties, can be any type
    public void setX(int x) {
        this.x = x;
    }
    public void setY(String y) {
        this.y = y;
    }
}