Answer:
I believe you want a subclass so here it is!
public class ReadWrite extends ReadOnly {
public ReadWrite(int initialValue){
super(initialValue);
}
private boolean modified = false;
public void setVal(int x) {
val = x;
modified = true;
}
public boolean isDirty() {
return modified;
}
}
Step-by-step explanation:
I might be wrong, just check through it in case
Hope this helped
:)