I need to create an Object which is in-complete without the constructor argument. Something like this
Class A {
private final int timeOut
public A(int t
Do it explicitly:
interface Bean {
void setTimeout(int timeout);
}
class BeanImpl implements Bean {
private int timeout;
@Override
public void setTimeout(int timeout) {
this.timeout = timeout;
}
...
}
...
...
class Client {
private Bean bean;
public void setBean(Bean bean) {
this.bean = bean;
}
...
public void methodThatUsesBean() {
int timeout = calculateTimeout();
bean.setTimeout(timeout);
...
}
}