Можно ли внести изменения, как указано в приведенном ниже классе, и инициализировать член для существующих абонентов некоторым значением по умолчанию, скажем, null
?
Член требуется длябыть личный финал как требование к постоянству.
// initial version of the class
public class A {
A() {
// do some work here
}
}
// the following modification required adding additional constructor to the class with **member** data member.
public class A {
private final String member;
A(String member) {
this();
this.member = member;
}
A() {
// initilize member to null if a client called this constructor
// do some work here
}
}