This question already has an answer here:
There's some code:
@Override public boolean equals(Object o) {
if (o instanceof SlowSet) {
if (size() == ((SlowSet)o).size())
Iterator<E> it1 = iterator();
}
}
The compiler says that variable declaration not allowed there. But If I do it by the following way,
@Override public boolean equals(Object o) {
if (o instanceof SlowSet) {
Iterator<E> it1 = iterator();
}
}
the problem will be disappeared. What's wrong?
Aucun commentaire:
Enregistrer un commentaire