Actually, I need to know at compile time that the modified list is changing.
It's impossible.
, , /. , , , .
, , ... ... " ". , , " ".
, , .
, .
№1:
public interface UnmodifiableList<T> {
public T get(int pos);
....
}
public interface List<T> extends UnmodifiableList<T> {
public void add(T elem);
....
}
, , . UnmodifiableList... .
2:
public interface List <T> {
public T get(int pos);
public void add(T elem);
....
}
public interface UnmodifiableList<T> {
}
, , . ( ...) , , UnmodifiableList, - add, , .
, .