Type @Override on a toString override
Type @Override on a toString override
Answer
@Override public String toString() { return "MyList"; }
@Override tells the compiler "this must override a method in the parent class or an implemented interface." If it does not — due to a typo or wrong signature — the code fails to compile.